Package com.google.common.io
Interface ByteArrayDataOutput
- 
- All Superinterfaces:
 DataOutput
@GwtIncompatible public interface ByteArrayDataOutput extends DataOutput
An extension ofDataOutputfor writing to in-memory byte arrays; its methods offer identical functionality but do not throwIOException.- Since:
 - 1.0
 - Author:
 - Jayaprabhakar Kadarkarai
 
 
- 
- 
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description byte[]toByteArray()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)voidwriteUTF(String s) 
 - 
 
- 
- 
Method Detail
- 
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
void writeChars(String s)
- Specified by:
 writeCharsin interfaceDataOutput
 
- 
writeUTF
void writeUTF(String s)
- Specified by:
 writeUTFin interfaceDataOutput
 
- 
writeBytes
@Deprecated void writeBytes(String s)
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. 
 - 
 
 -