@Override public int read(byte[] buf) throws IOException { return read(buf, 0, buf.length); }
@Override public int read(byte[] buf) throws IOException { return read(buf, 0, buf.length); }
@Override public int read(byte[] buf) throws IOException { return read(buf, 0, buf.length); }
public int read() throws IOException { if (position == size) { return -1; // EOF } if (position < buffer.length) { // Convert to unsigned int. int c = buffer[(int) position] & 0xFF; position++; return c; } int c = diskStream.read(); if (c >= 0) { position++; } return c; }
public int read() throws IOException { if (position == size) { return -1; // EOF } if (position < buffer.length) { // Convert to unsigned int. int c = buffer[(int) position] & 0xFF; position++; return c; } int c = diskStream.read(); if (c >= 0) { position++; } return c; }
public int read() throws IOException { if (position == size) { return -1; // EOF } if (position < buffer.length) { // Convert to unsigned int. int c = buffer[(int) position] & 0xFF; position++; return c; } int c = diskStream.read(); if (c >= 0) { position++; } return c; }
public int read(byte[] b, int off, int len) throws IOException { if (position == size) { return -1; // EOF } if (position < buffer.length) { int toCopy = (int)Math.min(size - position, Math.min(len, buffer.length - position)); System.arraycopy(buffer, (int)position, b, off, toCopy); if (toCopy > 0) { position += toCopy; } return toCopy; } // into disk zone int read = diskStream.read(b,off,len); if(read>0) { position += read; } return read; }
public int read(byte[] b, int off, int len) throws IOException { if (position == size) { return -1; // EOF } if (position < buffer.length) { int toCopy = (int)Math.min(size - position, Math.min(len, buffer.length - position)); System.arraycopy(buffer, (int)position, b, off, toCopy); if (toCopy > 0) { position += toCopy; } return toCopy; } // into disk zone int read = diskStream.read(b,off,len); if(read>0) { position += read; } return read; }
public int read(byte[] b, int off, int len) throws IOException { if (position == size) { return -1; // EOF } if (position < buffer.length) { int toCopy = (int)Math.min(size - position, Math.min(len, buffer.length - position)); System.arraycopy(buffer, (int)position, b, off, toCopy); if (toCopy > 0) { position += toCopy; } return toCopy; } // into disk zone int read = diskStream.read(b,off,len); if(read>0) { position += read; } return read; }