public ByteArrayBuilder(BufferRecycler br, int firstBlockSize) { _bufferRecycler = br; if (br == null) { _currBlock = new byte[firstBlockSize]; } else { _currBlock = br.allocByteBuffer(BufferRecycler.ByteBufferType.WRITE_CONCAT_BUFFER); } }
public final byte[] allocWriteEncodingBuffer() { if (_writeEncodingBuffer != null) { throw new IllegalStateException("Trying to call allocWriteEncodingBuffer() second time"); } _writeEncodingBuffer = _bufferRecycler.allocByteBuffer(BufferRecycler.ByteBufferType.WRITE_ENCODING_BUFFER); return _writeEncodingBuffer; }
/** *<p> * Note: the method can only be called once during its life cycle. * This is to protect against accidental sharing. */ public final byte[] allocReadIOBuffer() { if (_readIOBuffer != null) { throw new IllegalStateException("Trying to call allocReadIOBuffer() second time"); } _readIOBuffer = _bufferRecycler.allocByteBuffer(BufferRecycler.ByteBufferType.READ_IO_BUFFER); return _readIOBuffer; }
public ByteArrayBuilder(BufferRecycler br, int firstBlockSize) { _bufferRecycler = br; if (br == null) { _currBlock = new byte[firstBlockSize]; } else { _currBlock = br.allocByteBuffer(BufferRecycler.ByteBufferType.WRITE_CONCAT_BUFFER); } }
public final byte[] allocWriteEncodingBuffer() { if (_writeEncodingBuffer != null) { throw new IllegalStateException("Trying to call allocWriteEncodingBuffer() second time"); } _writeEncodingBuffer = _bufferRecycler.allocByteBuffer(BufferRecycler.ByteBufferType.WRITE_ENCODING_BUFFER); return _writeEncodingBuffer; }
/** *<p> * Note: the method can only be called once during its life cycle. * This is to protect against accidental sharing. */ public final byte[] allocReadIOBuffer() { if (_readIOBuffer != null) { throw new IllegalStateException("Trying to call allocReadIOBuffer() second time"); } _readIOBuffer = _bufferRecycler.allocByteBuffer(BufferRecycler.ByteBufferType.READ_IO_BUFFER); return _readIOBuffer; }
public ByteArrayBuilder(BufferRecycler br, int firstBlockSize) { _bufferRecycler = br; if (br == null) { _currBlock = new byte[firstBlockSize]; } else { _currBlock = br.allocByteBuffer(BufferRecycler.ByteBufferType.WRITE_CONCAT_BUFFER); } }
public ByteArrayBuilder(BufferRecycler br, int firstBlockSize) { _bufferRecycler = br; if (br == null) { _currBlock = new byte[firstBlockSize]; } else { _currBlock = br.allocByteBuffer(BufferRecycler.ByteBufferType.WRITE_CONCAT_BUFFER); } }
/** *<p> * Note: the method can only be called once during its life cycle. * This is to protect against accidental sharing. */ public final byte[] allocReadIOBuffer() { if (_readIOBuffer != null) { throw new IllegalStateException("Trying to call allocReadIOBuffer() second time"); } _readIOBuffer = _bufferRecycler.allocByteBuffer(BufferRecycler.ByteBufferType.READ_IO_BUFFER); return _readIOBuffer; }
/** *<p> * Note: the method can only be called once during its life cycle. * This is to protect against accidental sharing. */ public byte[] allocReadIOBuffer() { if (_readIOBuffer != null) { throw new IllegalStateException("Trying to call allocReadIOBuffer() second time"); } _readIOBuffer = _bufferRecycler.allocByteBuffer(BufferRecycler.ByteBufferType.READ_IO_BUFFER); return _readIOBuffer; }
public byte[] allocWriteIOBuffer() { if (_writeIOBuffer != null) { throw new IllegalStateException("Trying to call allocWriteIOBuffer() second time"); } _writeIOBuffer = _bufferRecycler.allocByteBuffer(BufferRecycler.ByteBufferType.WRITE_IO_BUFFER); return _writeIOBuffer; }
public final byte[] allocWriteEncodingBuffer() { if (_writeEncodingBuffer != null) { throw new IllegalStateException("Trying to call allocWriteEncodingBuffer() second time"); } _writeEncodingBuffer = _bufferRecycler.allocByteBuffer(BufferRecycler.ByteBufferType.WRITE_ENCODING_BUFFER); return _writeEncodingBuffer; }
public final byte[] allocWriteEncodingBuffer() { if (_writeEncodingBuffer != null) { throw new IllegalStateException("Trying to call allocWriteEncodingBuffer() second time"); } _writeEncodingBuffer = _bufferRecycler.allocByteBuffer(BufferRecycler.ByteBufferType.WRITE_ENCODING_BUFFER); return _writeEncodingBuffer; }
/** *<p> * Note: the method can only be called once during its life cycle. * This is to protect against accidental sharing. */ public final byte[] allocReadIOBuffer() { if (_readIOBuffer != null) { throw new IllegalStateException("Trying to call allocReadIOBuffer() second time"); } _readIOBuffer = _bufferRecycler.allocByteBuffer(BufferRecycler.ByteBufferType.READ_IO_BUFFER); return _readIOBuffer; }