@Override public Bytes writeChar(int offset, char c) { checkWrite(offset, CHARACTER); try { seekToOffset(offset); randomAccessFile.writeChar(c); } catch (IOException e) { throw new RuntimeException(e); } return this; }
RandomAccessFile logfile; public void initLogger(String logPath) { File fl = new File(logPath); long fileLength = fl.length(); logfile = new RandomAccessFile(fl, "rw"); logfile.seek(fileLength); } public void log(String text) throws IOException { logfile.writeChars(text); logfile.writeChar('\n'); }
@Override public void writeChar(int i) throws IOException { try { getRaf().writeChar(i); } catch (IOException ioe) { handleException(); throw ioe; } }
public void writeChar(int v) throws IOException { delegate.writeChar(v); } public void writeInt(int v) throws IOException { delegate.writeInt(v); }
@Override public void writeChar(final int v) throws IOException { raf.writeChar(v); }
@Override public void writeChar(final int v) throws IOException { raf.writeChar(v); }
public void writeChar(int v) throws IOException { raf.writeChar(v); }
public synchronized void writeChar(long seek, char value) throws IOException { super.seek(seek); super.writeChar(value); buffer.clear(); }
/** * Writes a * <code>char</code> to the file as a two-byte value, high byte first. The * write starts at the current position of the file pointer. * * @param v a <code>char</code> value to be written. * @exception IOException if an I/O error occurs. */ public synchronized final void writeChar(int v) throws IOException { resetPosition(); raf.writeChar(v); }
@Override public Bytes writeChar(long offset, char c) { checkWrite(offset, CHARACTER); try { seekToOffset(offset); randomAccessFile.writeChar(c); } catch (IOException e) { throw new RuntimeException(e); } return this; }
@Override public Bytes writeChar(long offset, char c) { checkWrite(offset, CHARACTER); try { seekToOffset(offset); randomAccessFile.writeChar(c); } catch (IOException e) { throw new RuntimeException(e); } return this; }
@Override public Bytes writeChar(int offset, char c) { checkWrite(offset, CHARACTER); try { seekToOffset(offset); randomAccessFile.writeChar(c); } catch (IOException e) { throw new RuntimeException(e); } return this; }
@Override public Bytes writeChar(long offset, char c) { checkWrite(offset, CHARACTER); try { seekToOffset(offset); randomAccessFile.writeChar(c); } catch (IOException e) { throw new RuntimeException(e); } return this; }
@Override public Bytes writeChar(long offset, char c) { checkWrite(offset, CHARACTER); try { seekToOffset(offset); randomAccessFile.writeChar(c); } catch (IOException e) { throw new RuntimeException(e); } return this; }
@Override public Bytes writeChar(int offset, char c) { checkWrite(offset, CHARACTER); try { seekToOffset(offset); randomAccessFile.writeChar(c); } catch (IOException e) { throw new RuntimeException(e); } return this; }
/** * Writes an unsigned char to the RandomAccessFile f. This method is a wrapper around {@link * java.io.RandomAccessFile#writeChar(int) writeChar(int)}, but assumes the input should be * interpreted as unsigned. */ @SuppressWarnings("signedness") public static void writeUnsignedChar(RandomAccessFile f, @Unsigned char c) throws IOException { f.writeChar(toUnsignedInt(c)); }
@Override public void writeChar(int i) throws IOException { try { getRaf().writeChar(i); } catch (IOException ioe) { handleException(); throw ioe; } }
@Override public void writeChar(int i) throws IOException { try { getRaf().writeChar(i); } catch (IOException ioe) { handleException(); throw ioe; } }
@Override public void writeChar(int i) throws IOException { try { getRaf().writeChar(i); } catch (IOException ioe) { handleException(); throw ioe; } }
@Test(expected = FileReactiveAuditException.class) public void writeChar() throws IOException { ReactiveAudit.off.commit(); try (RandomAccessFile rw = newRandomAccessFile()) { TestTools.strict.commit(); rw.writeChar(0); } }