1.00
B4IRandomAccessFile
RandomAccessFile
Initialize:::
Opens the specified file in big endian mode.
void
Dir
NSString*
FileName
NSString*
ReadOnly
BOOL
Initialize2::::
Opens the specified file with the specified endianess mode.
void
Dir
NSString*
FileName
NSString*
ReadOnly
BOOL
LittleEndian
BOOL
Initialize3::
Treats the array of bytes as a random access file with a constant size.
void
Buffer
byte[]
LittleEndian
BOOL
Close
Closes the file.
void
Flush
Writes any cached data to the file.
void
ReadShort:
Reads a Short value (2 bytes). The position is updated automatically.
short
Position
long long
ReadInt:
Reads an Int value (4 bytes). The position is updated automatically.
int
Position
long long
ReadLong:
Reads a Long value (8 bytes). The position is updated automatically.
long long
Position
long long
ReadFloat:
Reads a Float value (4 bytes). The position is updated automatically.
float
Position
long long
ReadDouble:
Reads a Double value (8 bytes). The position is updated automatically.
double
Position
long long
ReadBytes::::
Reads the bytes from Position to Position + Length (exclusive) and writes them to the given array starting from StartOffset.
The position is updated automatically.
void
Buffer
byte[]
StartOffset
int
Length
int
Position
long long
WriteBytes::::
Writes the bytes from the array to the file. The position is updated automatically.
void
Buffer
byte[]
StartOffset
int
Length
int
Position
long long
WriteShort::
Writes a Short value (2 bytes). The position is updated automatically.
void
Value
short
Position
long long
WriteByte::
Writes a single Byte. The position is updated automatically.
void
Value
unsigned char
Position
long long
WriteInt::
Writes an Int value (4 bytes). The position is updated automatically.
void
Value
int
Position
long long
WriteLong::
Writes a Long value (8 bytes). The position is updated automatically.
void
Value
long long
Position
long long
WriteDouble::
Writes Double value (8 bytes). The position is updated automatically.
void
Value
double
Position
long long
WriteFloat::
Writes a Float value (4 bytes). The position is updated automatically.
void
Value
float
Position
long long
WriteB4XObject::
Writes the given object to the file.
This method is capable of writing the following types: Lists, Arrays, Maps, Strings, primitive types and user types.
Combinations of these types are also supported.
void
Object
NSObject*
Position
long long
ReadB4XObject:
Reads an object previously saved with WriteB4XObject. See WriteB4XObject for the supported types.
NSObject*
Position
long long
ReadUnsignedByte:
Reads a single byte. The position is updated automatically.
unsigned char
Position
long long
CurrentPosition
Returns the current file position. The position is updated automatically after each operation.
long long
p
long long
Size
Returns the total size.
long long
B4IByteConverter
ByteConverter
IntsFromBytes:
Converts an array of Bytes to an array of Ints. Each 4 bytes are converted to an Int.
int[]
Bytes
byte[]
ShortsToBytes:
Converts an array of Shorts to an array of Bytes. Each Short is converted to 2 bytes.
byte[]
Shorts
short[]
LongsToBytes:
Converts an array of Longs to an array of Bytes. Each Long is converted to 8 bytes.
byte[]
Longs
long[]
LongsFromBytes:
Converts an array of Bytes to an array of Longs. Each 8 bytes are converted to a Long.
long[]
Bytes
byte[]
IntsToBytes:
Converts an array of Ints to an array of Bytes. Each Int is converted to 4 bytes.
byte[]
Ints
int[]
ShortsFromBytes:
Converts an array of Bytes to an array of Shorts. Each 2 bytes are converted to a Short.
short[]
Bytes
byte[]
DoublesFromBytes:
Converts an array of Bytes to an array of Doubles. Each 8 bytes are converted to a Double.
double[]
Bytes
byte[]
DoublesToBytes:
Converts an array of Doubles to an array of Bytes. Each Double is converted to 8 bytes.
byte[]
Doubles
double[]
StringFromBytes::
Converts the bytes to a string. Similar to BytesToString keyword.
NSString*
Bytes
byte[]
Encoding
NSString*
StringToBytes::
Converts the string to an array of bytes.
byte[]
Str
NSString*
Encoding
NSString*
FloatsFromBytes:
Converts an array of Bytes to an array of Floats. Each 4 bytes are converted to a Float.
float[]
Bytes
byte[]
FloatsToBytes:
Converts an array of Floats to an array of Bytes. Each Float is converted to 4 bytes.
byte[]
Doubles
float[]
HexFromBytes:
Returns the hex representation of the given bytes.
NSString*
Bytes
byte[]
HexToBytes:
Parses a hex string to an array of bytes.
byte[]
Hex
NSString*
ArrayCopy:::::
Copies data from the source array to the destination array.
Src - The source array.
SrcOffset - The position of the first byte that will be copied.
Dest - The destination array.
DestOffset - The position in the destination array of the first byte.
Count - Number of bytes to copy.
void
Src
byte[]
SrcOffset
int
Dest
byte[]
DestOffset
int
Count
int
SupportedEncodings
Returns an array of strings with the supported encodings.
NSString[]
LittleEndian
Gets or sets the converter endianess. The default value is False (big endian).
BOOL
p
BOOL
B4ICompressedStreams
CompressedStreams
CompressBytes::
Compresses the Data array using zlib or gzip compression. Returns the compressed data as an array of bytes.
Data - The data to compress.
CompressMethod - "zlib" or "gzip"
byte[]
Data
byte[]
CompressMethod
NSString*
DecompressBytes::
Decompresses the data using zlib or gzip compression. Returns the uncompressed data as an array of bytes.
CompressedData - The data to decompress.
CompressMethod - "zlib" or "gzip"
byte[]
CompressedData
byte[]
CompressMethod
NSString*
B4IAsyncStreams
AsyncStreams
NewData (Buffer() As Byte)
Error
Terminated
Initialize::::
Initializes AsyncStreams in standard mode.
void
bi1
B4I*
In
NSInputStream*
Out
NSOutputStream*
EventName
NSString*
InitializePrefix:::::
Initializes AsyncStreams in prefix mode. This mode can only be used if both sides of the connection adhere to the "prefix" protocol.
In / Out - The monitored streams.
BigEndian - The prefix endianess.
void
bi1
B4I*
In
NSInputStream*
BigEndian
BOOL
Out
NSOutputStream*
EventName
NSString*
Write:
Asynchronously writes all the data in the array.
BOOL
Buffer
byte[]
Write2:::
Asynchronously writes the data.
Buffer - The array holding the data.
Start - The position in the array of the first byte that will be written.
Length - Number of bytes to write.
BOOL
Buffer
byte[]
Start
int
Length
int
Close
Closes the monitored streams.
void
IsInitialized
BOOL
1.01
libz.dylib