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.void
write
(byte[] b) void
write
(byte[] b, int off, int len) void
write
(int b) void
writeBoolean
(boolean v) void
writeByte
(int v) void
writeBytes
(String s) Deprecated.This method is dangerous as it discards the high byte of every character.void
writeChar
(int v) void
writeChars
(String s) void
writeDouble
(double v) void
writeFloat
(float v) void
writeInt
(int v) void
writeLong
(long v) void
writeShort
(int v) void
-
Method Details
-
write
- Specified by:
write
in interfaceDataOutput
-
write
- Specified by:
write
in interfaceDataOutput
-
write
- Specified by:
write
in interfaceDataOutput
-
writeBoolean
- Specified by:
writeBoolean
in interfaceDataOutput
-
writeByte
- Specified by:
writeByte
in interfaceDataOutput
-
writeShort
- Specified by:
writeShort
in interfaceDataOutput
-
writeChar
- Specified by:
writeChar
in interfaceDataOutput
-
writeInt
- Specified by:
writeInt
in interfaceDataOutput
-
writeLong
- Specified by:
writeLong
in interfaceDataOutput
-
writeFloat
- Specified by:
writeFloat
in interfaceDataOutput
-
writeDouble
- Specified by:
writeDouble
in interfaceDataOutput
-
writeChars
- Specified by:
writeChars
in interfaceDataOutput
-
writeUTF
- Specified by:
writeUTF
in 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:
writeBytes
in interfaceDataOutput
-
toByteArray
byte[] toByteArray()Returns the contents that have been written to this instance, as a byte array.
-