/** * Writes a <code>boolean</code> to the file as a 1-byte value. The * value <code>true</code> is written out as the value * <code>(byte)1</code>; the value <code>false</code> is written out * as the value <code>(byte)0</code>. * * @param v a <code>boolean</code> value to be written. * @throws IOException if an I/O error occurs. */ public final void writeBoolean(boolean v) throws IOException { write(v ? 1 : 0); }
private void writeString(String s) throws IOException { // if (s.length() == 0) // System.out.println("HEY"); byte[] b = s.getBytes(CDM.utf8Charset); // all strings are encoded in UTF-8 Unicode. raf.writeInt(b.length); raf.write(b); pad(b.length, (byte) 0); }
/** * Writes a <code>byte</code> to the file as a 1-byte value. * * @param v a <code>byte</code> value to be written. * @throws IOException if an I/O error occurs. */ public final void writeByte(int v) throws IOException { write(v); }
/** * Writes an <code>int</code> to the file as four bytes, high byte first. * * @param v an <code>int</code> to be written. * @throws IOException if an I/O error occurs. */ public final void writeInt(int v) throws IOException { write((v >>> 24) & 0xFF); write((v >>> 16) & 0xFF); write((v >>> 8) & 0xFF); write((v) & 0xFF); }
/** * Writes a <code>byte</code> to the file as a 1-byte value. * * @param v a <code>byte</code> value to be written. * @throws IOException if an I/O error occurs. */ public final void writeByte(int v) throws IOException { write(v); }
/** * Writes an <code>int</code> to the file as four bytes, high byte first. * * @param v an <code>int</code> to be written. * @throws IOException if an I/O error occurs. */ public final void writeInt(int v) throws IOException { write((v >>> 24) & 0xFF); write((v >>> 16) & 0xFF); write((v >>> 8) & 0xFF); write((v) & 0xFF); }
/** * Writes a <code>byte</code> to the file as a 1-byte value. * * @param v a <code>byte</code> value to be written. * @throws IOException if an I/O error occurs. */ public final void writeByte(int v) throws IOException { write(v); }
/** * Writes a <code>byte</code> to the file as a 1-byte value. * * @param v a <code>byte</code> value to be written. * @throws IOException if an I/O error occurs. */ public final void writeByte(int v) throws IOException { write(v); }
/** * Writes a <code>boolean</code> to the file as a 1-byte value. The * value <code>true</code> is written out as the value * <code>(byte)1</code>; the value <code>false</code> is written out * as the value <code>(byte)0</code>. * * @param v a <code>boolean</code> value to be written. * @throws IOException if an I/O error occurs. */ public final void writeBoolean(boolean v) throws IOException { write(v ? 1 : 0); }
/** * Writes an <code>int</code> to the file as four bytes, high byte first. * * @param v an <code>int</code> to be written. * @throws IOException if an I/O error occurs. */ public final void writeInt(int v) throws IOException { write((v >>> 24) & 0xFF); write((v >>> 16) & 0xFF); write((v >>> 8) & 0xFF); write((v) & 0xFF); }
private void pad(int nbytes, byte fill) throws IOException { int pad = padding(nbytes); for (int i = 0; i < pad; i++) raf.write(fill); }
private void pad(int nbytes, byte fill) throws IOException { int pad = padding(nbytes); for (int i = 0; i < pad; i++) raf.write(fill); }
private void pad(int nbytes, byte fill) throws IOException { int pad = padding(nbytes); for (int i = 0; i < pad; i++) raf.write(fill); }