Methods Summary |
---|
public void | dispose()Close of this stream and any substreams that have been created from it.
Iterator it = _subStreams.iterator();
while (it.hasNext())
{
try
{
((SharedFileInputStream)it.next()).dispose();
}
catch (IOException e)
{
// ignore
}
}
in.close();
|
public long | getPosition()
return _position;
|
public org.bouncycastle.mail.smime.util.SharedFileInputStream | getRoot()Return the shared stream that represents the top most stream that
this stream inherits from.
if (_parent != null)
{
return _parent.getRoot();
}
return this;
|
public void | mark(int readLimit)
_markedPosition = _position;
in.mark(readLimit);
|
public boolean | markSupported()
return true;
|
public java.io.InputStream | newStream(long start, long finish)
try
{
SharedFileInputStream stream;
if (finish < 0)
{
if (_length > 0)
{
stream = new SharedFileInputStream(this, _start + start, _length - start);
}
else if (_length == 0)
{
stream = new SharedFileInputStream(this, _start + start, 0);
}
else
{
stream = new SharedFileInputStream(this, _start + start, -1);
}
}
else
{
stream = new SharedFileInputStream(this, _start + start, finish - start);
}
_subStreams.add(stream);
return stream;
}
catch (IOException e)
{
throw new IllegalStateException("unable to create shared stream: " + e);
}
|
public int | read(byte[] buf)
return this.read(buf, 0, buf.length);
|
public int | read(byte[] buf, int off, int len)
int count = 0;
if (len == 0)
{
return 0;
}
while (count < len)
{
int ch = this.read();
if (ch < 0)
{
break;
}
buf[off + count] = (byte)ch;
count++;
}
if (count == 0)
{
return -1; // EOF
}
return count;
|
public int | read()
if (_position == _length)
{
return -1;
}
_position++;
return in.read();
|
public void | reset()
_position = _markedPosition;
in.reset();
|
public long | skip(long n)
long count;
for (count = 0; count != n; count++)
{
if (this.read() < 0)
{
break;
}
}
return count;
|