|
Java EE 5 SDK | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object extended by java.io.InputStream extended by java.io.ByteArrayInputStream extended by javax.mail.util.SharedByteArrayInputStream
public class SharedByteArrayInputStream
A ByteArrayInputStream that implements the SharedInputStream interface, allowing the underlying byte array to be shared between multiple readers.
Field Summary | |
---|---|
protected int |
start
Position within shared buffer that this stream starts at. |
Fields inherited from class java.io.ByteArrayInputStream |
---|
buf, count, mark, pos |
Constructor Summary | |
---|---|
SharedByteArrayInputStream(byte[] buf)
Create a SharedByteArrayInputStream representing the entire byte array. |
|
SharedByteArrayInputStream(byte[] buf,
int offset,
int length)
Create a SharedByteArrayInputStream representing the part of the byte array from offset for length
bytes. |
Method Summary | |
---|---|
long |
getPosition()
Return the current position in the InputStream, as an offset from the beginning of the InputStream. |
InputStream |
newStream(long start,
long end)
Return a new InputStream representing a subset of the data from this InputStream, starting at start (inclusive)
up to end (exclusive). |
Methods inherited from class java.io.ByteArrayInputStream |
---|
available, close, mark, markSupported, read, read, reset, skip |
Methods inherited from class java.io.InputStream |
---|
read |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int start
Constructor Detail |
---|
public SharedByteArrayInputStream(byte[] buf)
buf
- the byte arraypublic SharedByteArrayInputStream(byte[] buf, int offset, int length)
offset
for length
bytes.
buf
- the byte arrayoffset
- offset in byte array to first byte to includelength
- number of bytes to includeMethod Detail |
---|
public long getPosition()
getPosition
in interface SharedInputStream
public InputStream newStream(long start, long end)
start
(inclusive)
up to end
(exclusive). start
must be
non-negative. If end
is -1, the new stream ends
at the same place as this stream. The returned InputStream
will also implement the SharedInputStream interface.
newStream
in interface SharedInputStream
start
- the starting positionend
- the ending position + 1
|
Java EE 5 SDK | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
Scripting on this page tracks web page traffic, but does not change the content in any way.