@Override public void write(final byte[] b, final int off, final int len) throws IOException { if (off < 0 || len < 0 || off+len > b.length) { throw new IndexOutOfBoundsException(); } if (currentAddress + len > memory.length()) { buffer = buffer.realloc(memory.length()*2); memory = buffer.memory(); write(b, off, len); } else { memory.putBytes(currentAddress, b, off, len); currentAddress+=len; } }
public void writeBoolean(final boolean v) throws IOException { if (currentAddress + 1 > memory.length()) { buffer = buffer.realloc(memory.length()*2); memory = buffer.memory(); writeBoolean(v); } else { memory.putByte(currentAddress, (byte)(v ? 1 : 0)); currentAddress++; } }
public void writeShort(final int v) throws IOException { if (currentAddress + 2 > memory.length()) { buffer = buffer.realloc(memory.length()*2); memory = buffer.memory(); writeShort(v); } else { memory.putShort(currentAddress, (short)v); currentAddress+=2; } }
public void writeChar(final int v) throws IOException { if (currentAddress + 2 > memory.length()) { buffer = buffer.realloc(memory.length()*2); memory = buffer.memory(); writeChar(v); } else { memory.putChar(currentAddress, (char)v); currentAddress+=2; } }
public void writeByte(final int v) throws IOException { if (currentAddress + 1 > memory.length()) { buffer = buffer.realloc(memory.length()*2); memory = buffer.memory(); writeByte(v); } else { memory.putByte(currentAddress, (byte)v); currentAddress++; } }
public void writeInt(final int v) throws IOException { if (currentAddress + 4 > memory.length()) { buffer = buffer.realloc(memory.length()*2); memory = buffer.memory(); writeInt(v); } else { memory.putInt(currentAddress, v); currentAddress+=4; } }
public void writeFloat(final float v) throws IOException { if (currentAddress + 4 > memory.length()) { buffer = buffer.realloc(memory.length()*2); memory = buffer.memory(); writeFloat(v); } else { memory.putFloat(currentAddress, v); currentAddress+=4; } }
public void writeLong(final long v) throws IOException { if (currentAddress + 8 > memory.length()) { buffer = buffer.realloc(memory.length()*2); memory = buffer.memory(); writeLong(v); } else { memory.putLong(currentAddress, v); currentAddress+=8; } }
public void writeDouble(final double v) throws IOException { if (currentAddress + 8 > memory.length()) { buffer = buffer.realloc(memory.length()*2); memory = buffer.memory(); writeDouble(v); } else { memory.putDouble(currentAddress, v); currentAddress+=8; } }
final NativeBuffer buffer = valuesFileOut.getBuffer().realloc(valuesFileOut.position()); return Pair.of(offsets, buffer); } catch (Throwable t) {