Method | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
CopyBytes ( |
Copy numBytes bytes from input to ourself.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Write ( byte b, int off, int len ) : void | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
WriteByte ( byte b ) : void |
Writes a single byte. The most primitive data type is an eight-bit byte. Files are accessed as sequences of bytes. All other data types are defined as sequences of bytes, so file formats are byte-order independent.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
WriteBytes ( byte b, int length ) : void | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
WriteBytes ( byte b, int offset, int length ) : void |
Writes an array of bytes.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
WriteInt ( int i ) : void |
Writes an int as four bytes. 32-bit unsigned integer written as four bytes, high-order bytes first.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
WriteLong ( long i ) : void |
Writes a long as eight bytes. 64-bit unsigned integer written as eight bytes, high-order bytes first.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
WriteShort ( short i ) : void |
Writes a short as two bytes.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
WriteString ( string s ) : void |
Writes a string. Writes strings as UTF-8 encoded bytes. First the length, in bytes, is written as a #writeVInt VInt, followed by the bytes.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
WriteStringSet ( ISet |
Writes a String set. First the size is written as an #writeInt(int) Int32, followed by each value written as a #writeString(String) String.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
WriteStringStringMap ( string>.IDictionary |
Writes a String map. First the size is written as an #writeInt(int) Int32, followed by each key-value pair written as two consecutive #writeString(String) Strings.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
WriteVInt ( int i ) : void |
Writes an int in a variable-length format. Writes between one and five bytes. Smaller values take fewer bytes. Negative numbers are supported, but should be avoided. VByte is a variable-length format for positive integers is defined where the high-order bit of each byte indicates whether more bytes remain to be read. The low-order seven bits are appended as increasingly more significant bits in the resulting integer value. Thus values from zero to 127 may be stored in a single byte, values from 128 to 16,383 may be stored in two bytes, and so on. VByte Encoding Example
this provides compression while still being efficient to decode.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
WriteVLong ( long i ) : void |
Writes an long in a variable-length format. Writes between one and nine bytes. Smaller values take fewer bytes. Negative numbers are not supported. The format is described further in DataOutput#writeVInt(int).
|
public CopyBytes ( |
||
input | ||
numBytes | long | |
return | void |
public Write ( byte b, int off, int len ) : void | ||
b | byte | |
off | int | |
len | int | |
return | void |
public WriteBytes ( byte b, int length ) : void | ||
b | byte | |
length | int | |
return | void |
public abstract WriteBytes ( byte b, int offset, int length ) : void | ||
b | byte | the bytes to write |
offset | int | the offset in the byte array |
length | int | the number of bytes to write |
return | void |
public WriteStringSet ( ISet |
||
set | ISet |
Input set. May be null (equivalent to an empty set) |
return | void |
public WriteStringStringMap ( string>.IDictionary |
||
map | string>.IDictionary | Input map. May be null (equivalent to an empty map) |
return | void |
public WriteVInt ( int i ) : void | ||
i | int | Smaller values take fewer bytes. Negative numbers are /// supported, but should be avoided. |
return | void |