public abstract class DataOutput extends Object
Constructor and Description |
---|
DataOutput() |
Modifier and Type | Method and Description |
---|---|
void |
copyBytes(DataInput input,
long numBytes)
Copy numBytes bytes from input to ourself.
|
abstract void |
writeByte(byte b)
Writes a single byte.
|
void |
writeBytes(byte[] b,
int length)
Writes an array of bytes.
|
abstract void |
writeBytes(byte[] b,
int offset,
int length)
Writes an array of bytes.
|
void |
writeChars(char[] s,
int start,
int length)
Deprecated.
-- please pre-convert to utf8 bytes instead or use
writeString(java.lang.String) |
void |
writeChars(String s,
int start,
int length)
Deprecated.
-- please pre-convert to utf8 bytes
instead or use
writeString(java.lang.String) |
void |
writeInt(int i)
Writes an int as four bytes.
|
void |
writeLong(long i)
Writes a long as eight bytes.
|
void |
writeShort(short i)
Writes a short as two bytes.
|
void |
writeString(String s)
Writes a string.
|
void |
writeStringStringMap(Map<String,String> map) |
void |
writeVInt(int i)
Writes an int in a variable-length format.
|
void |
writeVLong(long i)
Writes an long in a variable-length format.
|
public abstract void writeByte(byte b) throws IOException
IOException
DataInput.readByte()
public void writeBytes(byte[] b, int length) throws IOException
b
- the bytes to writelength
- the number of bytes to writeIOException
DataInput.readBytes(byte[],int,int)
public abstract void writeBytes(byte[] b, int offset, int length) throws IOException
b
- the bytes to writeoffset
- the offset in the byte arraylength
- the number of bytes to writeIOException
DataInput.readBytes(byte[],int,int)
public void writeInt(int i) throws IOException
IOException
DataInput.readInt()
public void writeShort(short i) throws IOException
IOException
DataInput.readShort()
public final void writeVInt(int i) throws IOException
IOException
DataInput.readVInt()
public void writeLong(long i) throws IOException
IOException
DataInput.readLong()
public final void writeVLong(long i) throws IOException
IOException
DataInput.readVLong()
public void writeString(String s) throws IOException
IOException
DataInput.readString()
public void copyBytes(DataInput input, long numBytes) throws IOException
IOException
@Deprecated public void writeChars(String s, int start, int length) throws IOException
writeString(java.lang.String)
s
- the source of the charactersstart
- the first character in the sequencelength
- the number of characters in the sequenceIOException
@Deprecated public void writeChars(char[] s, int start, int length) throws IOException
writeString(java.lang.String)
s
- the source of the charactersstart
- the first character in the sequencelength
- the number of characters in the sequenceIOException
public void writeStringStringMap(Map<String,String> map) throws IOException
IOException