new jBinaryReader()
Binary Reader
Parameters:
Type | Description |
---|---|
Array | Byte Array |
- Source:
Methods
-
close()
-
Release all resource
- Source:
-
dispose()
-
Release all resource This function call
close
internally.- Source:
-
getLength() → {Int32}
-
Get length of binary array
- Source:
Returns:
- Current length of binary array- Type
- Int32
-
getPosition() → {Int32}
-
Get current position of binary array
- Source:
Returns:
- Current position of binary array- Type
- Int32
-
readAllBytes() → {Array}
-
Read all bytes that are remained.
- Source:
Returns:
- Byte array.- Type
- Array
-
readBoolean() → {Boolean}
-
Reads a boolean value from the current stream and advances the current position of the stream by one byte.
- Source:
Returns:
- Type
- Boolean
-
readByte() → {Byte}
-
Reads a byte value from the current stream and advances the current position of the stream by one byte.
- Source:
Returns:
- Type
- Byte
-
readBytes(count) → {Array}
-
Reads the specified number of bytes value from the current stream into a byte array and advances the current position by the number of bytes.
Parameters:
Name Type Description count
Int32 The number of bytes that to read. - Source:
Returns:
- Type
- Array
-
readChar() → {char}
-
Reads the next character from the current stream and advances the current position of the stream in accordance with the unicode used and the specific character being read from the stream.
- Source:
Returns:
- Type
- char
-
readChars() → {Array}
-
Reads the specified number of characters from the current stream, returns the data in a character array, and advances the current position in accordance with the unicode used and the specific character being read from the stream.
- Source:
Returns:
- Type
- Array
-
readInt16(endian) → {Int16}
-
Reads a 2-byte signed integer from the current stream and advances the current position of the stream by two bytes.
Parameters:
Name Type Description endian
String Endian option. This value have to be "little" or "big". Default value is "little". - Source:
Returns:
- Type
- Int16
-
readInt32(endian) → {Int32}
-
Reads a 4-byte signed integer from the current stream and advances the current position of the stream by four bytes.
Parameters:
Name Type Description endian
String Endian option. This value have to be "little" or "big". Default value is "little". - Source:
Returns:
- Type
- Int32
-
readInt64(endian) → {Int64}
-
Reads a 8-byte signed integer from the current stream and advances the current position of the stream by eight bytes.
Parameters:
Name Type Description endian
String Endian option. This value have to be "little" or "big". Default value is "little". - Source:
Returns:
- Type
- Int64
-
readUInt16(endian) → {UInt16}
-
Reads a 2-byte unsigned integer from the current stream and advances the current position of the stream by two bytes.
Parameters:
Name Type Description endian
String Endian option. This value have to be "little" or "big". Default value is "little". - Source:
Returns:
- Type
- UInt16
-
seek(offset, origin)
-
Sets the current position of this stream to the given value
Parameters:
Name Type Description offset
Number The point relative to origin from which to begin seeking. origin
String Specifies the beginning, the end, or the current position as a reference point for offset, using "Begin", "Current" or "End". - Source: