protected static class BufferInputStream.CopyProcessor extends Object implements ByteProcessor
ByteProcessor
used to copy bytes from the buffer to the caller consuming data from
this stream.Modifier and Type | Field and Description |
---|---|
private byte[] |
targetBuffer
The buffer to copy to.
|
private int |
targetOffset
The offset in
targetBuffer . |
Constructor and Description |
---|
CopyProcessor()
The constructor.
|
CopyProcessor(byte[] targetBuffer,
int targetOffset)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
process(byte[] buffer,
int offset,
int length)
This method is called to process the number of
length bytes from the given buffer starting from the
given offset . |
private byte[] targetBuffer
private int targetOffset
targetBuffer
.public CopyProcessor()
public CopyProcessor(byte[] targetBuffer, int targetOffset)
targetBuffer
- the buffer to copy to.targetOffset
- the offset in targetBuffer
.public int process(byte[] buffer, int offset, int length)
ByteProcessor
length
bytes from the given buffer
starting from the
given offset
. buffer
. It is NOT permitted to
modify the given buffer
unless this is explicitly specified by the calling object (typically an
implementation of ByteProcessable
).process
in interface ByteProcessor
buffer
- contains the bytes to process.offset
- is the index where to start in the buffer
.length
- is the number of bytes to proceed.length
. However you
can also return a value less than length and greater or equal to zero, in order to stop processing at a
specific position.Copyright © 2001–2016 mmm-Team. All rights reserved.