Package jetbrains.buildServer
Class RollingByteArrayOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.ByteArrayOutputStream
-
- jetbrains.buildServer.RollingByteArrayOutputStream
-
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
public class RollingByteArrayOutputStream extends ByteArrayOutputStream
output stream implementation which stores bytes into byte array likeByteArrayOutputStream
but it returns no more bytes than specified limit.
-
-
Field Summary
Fields Modifier and Type Field Description static int
MIN_BUFFER
-
Fields inherited from class java.io.ByteArrayOutputStream
buf, count
-
-
Constructor Summary
Constructors Constructor Description RollingByteArrayOutputStream(int limit)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
reset()
int
size()
byte[]
toByteArray()
String
toString()
String
toString(int hibyte)
String
toString(String charsetName)
void
write(byte[] b, int off, int len)
void
write(int b)
void
writeTo(OutputStream out)
-
Methods inherited from class java.io.OutputStream
flush, write
-
-
-
-
Field Detail
-
MIN_BUFFER
public static final int MIN_BUFFER
- See Also:
- Constant Field Values
-
-
Method Detail
-
write
public void write(int b)
- Overrides:
write
in classByteArrayOutputStream
-
write
public void write(@NotNull byte[] b, int off, int len)
- Overrides:
write
in classByteArrayOutputStream
-
writeTo
public void writeTo(OutputStream out) throws IOException
- Overrides:
writeTo
in classByteArrayOutputStream
- Throws:
IOException
-
reset
public void reset()
- Overrides:
reset
in classByteArrayOutputStream
-
size
public int size()
- Overrides:
size
in classByteArrayOutputStream
-
toString
public String toString()
- Overrides:
toString
in classByteArrayOutputStream
-
toString
public String toString(String charsetName) throws UnsupportedEncodingException
- Overrides:
toString
in classByteArrayOutputStream
- Throws:
UnsupportedEncodingException
-
toString
public String toString(int hibyte)
- Overrides:
toString
in classByteArrayOutputStream
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classByteArrayOutputStream
-
toByteArray
@NotNull public byte[] toByteArray()
- Overrides:
toByteArray
in classByteArrayOutputStream
-
-