Interface ByteArrayDataOutput
- All Superinterfaces:
DataOutput
An extension of
DataOutput for writing to in-memory byte arrays; its methods offer
identical functionality but do not throw IOException.- Since:
- 1.0
- Author:
- Jayaprabhakar Kadarkarai
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]Returns the contents that have been written to this instance, as a byte array.voidwrite(byte[] b) voidwrite(byte[] b, int off, int len) voidwrite(int b) voidwriteBoolean(boolean v) voidwriteByte(int v) voidwriteBytes(String s) Deprecated.This method is dangerous as it discards the high byte of every character.voidwriteChar(int v) voidwriteChars(String s) voidwriteDouble(double v) voidwriteFloat(float v) voidwriteInt(int v) voidwriteLong(long v) voidwriteShort(int v) void
-
Method Details
-
write
void write(int b) - Specified by:
writein interfaceDataOutput
-
write
void write(byte[] b) - Specified by:
writein interfaceDataOutput
-
write
void write(byte[] b, int off, int len) - Specified by:
writein interfaceDataOutput
-
writeBoolean
void writeBoolean(boolean v) - Specified by:
writeBooleanin interfaceDataOutput
-
writeByte
void writeByte(int v) - Specified by:
writeBytein interfaceDataOutput
-
writeShort
void writeShort(int v) - Specified by:
writeShortin interfaceDataOutput
-
writeChar
void writeChar(int v) - Specified by:
writeCharin interfaceDataOutput
-
writeInt
void writeInt(int v) - Specified by:
writeIntin interfaceDataOutput
-
writeLong
void writeLong(long v) - Specified by:
writeLongin interfaceDataOutput
-
writeFloat
void writeFloat(float v) - Specified by:
writeFloatin interfaceDataOutput
-
writeDouble
void writeDouble(double v) - Specified by:
writeDoublein interfaceDataOutput
-
writeChars
- Specified by:
writeCharsin interfaceDataOutput
-
writeUTF
- Specified by:
writeUTFin interfaceDataOutput
-
writeBytes
Deprecated.This method is dangerous as it discards the high byte of every character. For UTF-8, usewrite(s.getBytes(StandardCharsets.UTF_8)).- Specified by:
writeBytesin interfaceDataOutput
-
toByteArray
byte[] toByteArray()Returns the contents that have been written to this instance, as a byte array.
-