java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable@LimitedPrivate({"HDFS","MapReduce"})
@Unstable
public class BoundedByteArrayOutputStream
extends java.io.OutputStream
reset
API and choose different limits in each round.| Modifier | Constructor | Description |
|---|---|---|
protected |
BoundedByteArrayOutputStream(byte[] buf,
int offset,
int limit) |
|
|
BoundedByteArrayOutputStream(int capacity) |
Create a BoundedByteArrayOutputStream with the specified
capacity
|
|
BoundedByteArrayOutputStream(int capacity,
int limit) |
Create a BoundedByteArrayOutputStream with the specified
capacity and limit.
|
| Modifier and Type | Method | Description |
|---|---|---|
int |
available() |
|
byte[] |
getBuffer() |
Returns the underlying buffer.
|
int |
getLimit() |
Return the current limit.
|
void |
reset() |
Reset the buffer
|
void |
reset(int newlim) |
Reset the limit
|
protected void |
resetBuffer(byte[] buf,
int offset,
int limit) |
|
int |
size() |
Returns the length of the valid data
currently in the buffer.
|
void |
write(byte[] b,
int off,
int len) |
|
void |
write(int b) |
public BoundedByteArrayOutputStream(int capacity)
capacity - The capacity of the underlying byte arraypublic BoundedByteArrayOutputStream(int capacity,
int limit)
capacity - The capacity of the underlying byte arraylimit - The maximum limit upto which data can be writtenprotected BoundedByteArrayOutputStream(byte[] buf,
int offset,
int limit)
protected void resetBuffer(byte[] buf,
int offset,
int limit)
public void write(int b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void write(byte[] b,
int off,
int len)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void reset(int newlim)
newlim - New Limitpublic void reset()
public int getLimit()
public byte[] getBuffer()
size().public int size()
public int available()
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.