Methods Summary |
---|
public int | available()Return number of available bytes for reading.
int ret = blob.size - pos;
return (ret < 0) ? 0 : ret;
|
public void | close()Close this blob InputStream.
blob.close();
blob = null;
pos = 0;
|
public void | mark(int limit)Mark method; dummy to satisfy InputStream class.
|
public boolean | markSupported()Mark support; not for this class.
return false;
|
public int | read(byte[] b, int off, int len)Read slice of byte array from blob.
if (off + len > b.length) {
len = b.length - off;
}
if (len < 0) {
return -1;
}
if (len == 0) {
return 0;
}
int n = blob.read(b, off, pos, len);
if (n > 0) {
pos += n;
return n;
}
return -1;
|
public int | read()Read single byte from blob.
byte b[] = new byte[1];
int n = blob.read(b, 0, pos, b.length);
if (n > 0) {
pos += n;
return b[0];
}
return -1;
|
public int | read(byte[] b)Read byte array from blob.
int n = blob.read(b, 0, pos, b.length);
if (n > 0) {
pos += n;
return n;
}
return -1;
|
public void | reset()Reset method; dummy to satisfy InputStream class.
|
public long | skip(long n)Skip over blob data.
long ret = pos + n;
if (ret < 0) {
ret = 0;
pos = 0;
} else if (ret > blob.size) {
ret = blob.size;
pos = blob.size;
} else {
pos = (int) ret;
}
return ret;
|