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 SummaryModifier 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- 
writevoid write(int b) - Specified by:
- writein interface- DataOutput
 
- 
writevoid write(byte[] b) - Specified by:
- writein interface- DataOutput
 
- 
writevoid write(byte[] b, int off, int len) - Specified by:
- writein interface- DataOutput
 
- 
writeBooleanvoid writeBoolean(boolean v) - Specified by:
- writeBooleanin interface- DataOutput
 
- 
writeBytevoid writeByte(int v) - Specified by:
- writeBytein interface- DataOutput
 
- 
writeShortvoid writeShort(int v) - Specified by:
- writeShortin interface- DataOutput
 
- 
writeCharvoid writeChar(int v) - Specified by:
- writeCharin interface- DataOutput
 
- 
writeIntvoid writeInt(int v) - Specified by:
- writeIntin interface- DataOutput
 
- 
writeLongvoid writeLong(long v) - Specified by:
- writeLongin interface- DataOutput
 
- 
writeFloatvoid writeFloat(float v) - Specified by:
- writeFloatin interface- DataOutput
 
- 
writeDoublevoid writeDouble(double v) - Specified by:
- writeDoublein interface- DataOutput
 
- 
writeChars- Specified by:
- writeCharsin interface- DataOutput
 
- 
writeUTF- Specified by:
- writeUTFin interface- DataOutput
 
- 
writeBytesDeprecated.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 interface- DataOutput
 
- 
toByteArraybyte[] toByteArray()Returns the contents that have been written to this instance, as a byte array.
 
-