Package org.apache.solr.common.util
Class BytesOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.apache.solr.common.util.BytesOutputStream
-
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
public class BytesOutputStream extends OutputStream
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BytesOutputStream.Bytes
-
Constructor Summary
Constructors Constructor Description BytesOutputStream()
BytesOutputStream(int size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BytesOutputStream.Bytes
bytes()
void
close()
InputStream
inputStream()
void
reset()
int
size()
byte[]
toBytes()
String
toString(String charset)
void
write(byte[] b, int off, int len)
void
write(int b)
Write a byte to the stream.void
writeBytes(byte[] b)
-
Methods inherited from class java.io.OutputStream
flush, nullOutputStream, write
-
-
-
-
Method Detail
-
toBytes
public byte[] toBytes()
-
bytes
public BytesOutputStream.Bytes bytes()
-
inputStream
public InputStream inputStream()
-
write
public void write(int b)
Write a byte to the stream.- Specified by:
write
in classOutputStream
-
write
public void write(byte[] b, int off, int len)
- Overrides:
write
in classOutputStream
-
writeBytes
public void writeBytes(byte[] b)
-
reset
public void reset()
-
size
public int size()
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
-
-