private static RandomAccessInputStream openStream(String file) throws IOException { return new RandomAccessInputStream(getHandle(file), file); }
/** * @param b Source buffer to read data from. * @param off Offset within the buffer to start reading from. * @param len Number of bytes to read. * @throws IOException If there is an error writing to the stream. */ public void write(ByteBuffer b, int off, int len) throws IOException { flush(); outputFile.write(b, off, len); }
private byte[] getFixedHeader() throws IOException { in.seek(offset); byte[] header = new byte[(int) (sos - offset)]; in.read(header); int index = (int) (imageDimensions - offset); DataTools.unpackBytes(tileDim, header, index, 2, false); DataTools.unpackBytes(tileDim, header, index + 2, 2, false); return header; }
private static String findCaseInsensitive(Location name) throws IOException { // The file we're looking for doesn't exist, so look for it in the // same directory in a case-insensitive manner. Note that this will // throw an exception if multiple copies are found. return cache.lookup(name.getAbsoluteFile()).getAbsolutePath(); }
@Override public void writeBoolean(boolean v) throws IOException { flush(); outputFile.writeBoolean(v); }
@Override public void writeChars(String s) throws IOException { flush(); outputFile.writeChars(s); }
@Override public void writeFloat(float v) throws IOException { flush(); outputFile.writeFloat(v); }
@Override public void writeBytes(String s) throws IOException { flush(); outputFile.writeBytes(s); }
@Override public void writeDouble(double v) throws IOException { flush(); outputFile.writeDouble(v); }
@Override public void writeBoolean(boolean v) throws IOException { flush(); outputFile.writeBoolean(v); }
@Override public void writeChars(String s) throws IOException { flush(); outputFile.writeChars(s); }