public int doRead(ByteChunk chunk) { if (!isNeedToRead()) { // Read only once. return -1; } read = true; final int readableBytes = content.length(); chunk.setBytes(content.array(), content.offset(), readableBytes); return readableBytes; }
@Override public int doRead(ByteChunk chunk, Request request) throws IOException { if (read || content.isEmpty()) { // Read only once. return -1; } read = true; final int readableBytes = content.length(); chunk.setBytes(content.array(), content.offset(), readableBytes); return readableBytes; } }
@Override public void write(int b) throws IOException { // Shouldn't get used for good performance, but is needed for // compatibility with Sun JDK 1.4.0 singleByteBuffer[0] = (byte) (b & 0xff); outputChunk.setBytes(singleByteBuffer, 0, 1); buffer.doWrite(outputChunk, null); } @Override
@Override public void write(int b) throws IOException { // Shouldn't get used for good performance, but is needed for // compatibility with Sun JDK 1.4.0 singleByteBuffer[0] = (byte) (b & 0xff); outputChunk.setBytes(singleByteBuffer, 0, 1); buffer.doWrite(outputChunk, null); } @Override
@Override public void write(int b) throws IOException { // Shouldn't get used for good performance, but is needed for // compatibility with Sun JDK 1.4.0 singleByteBuffer[0] = (byte) (b & 0xff); outputChunk.setBytes(singleByteBuffer, 0, 1); buffer.doWrite(outputChunk, null); } @Override
public void write(int b) throws IOException { // Shouldn't get used for good performance, but is needed for // compatibility with Sun JDK 1.4.0 singleByteBuffer[0] = (byte) (b & 0xff); outputChunk.setBytes(singleByteBuffer, 0, 1); buffer.doWrite(outputChunk, null); } public void write(byte[] b, int off, int len)
public void write(byte[] b, int off, int len) throws IOException { outputChunk.setBytes(b, off, len); buffer.doWrite(outputChunk, null); } public void flush() throws IOException {}
public void write(byte[] b, int off, int len) throws IOException { outputChunk.setBytes(b, off, len); buffer.doWrite(outputChunk, null); } public void flush() throws IOException {}
public void write(int b) throws IOException { // Shouldn't get used for good performance, but is needed for // compatibility with Sun JDK 1.4.0 singleByteBuffer[0] = (byte) (b & 0xff); outputChunk.setBytes(singleByteBuffer, 0, 1); buffer.doWrite(outputChunk, null); } public void write(byte[] b, int off, int len)
@Override public void write(byte[] b, int off, int len) throws IOException { outputChunk.setBytes(b, off, len); buffer.doWrite(outputChunk, null); } @Override
@Override public void write(int b) throws IOException { // Shouldn't get used for good performance, but is needed for // compatibility with Sun JDK 1.4.0 singleByteBuffer[0] = (byte) (b & 0xff); outputChunk.setBytes(singleByteBuffer, 0, 1); buffer.doWrite(outputChunk, null); } @Override
@Override public void write(byte[] b, int off, int len) throws IOException { outputChunk.setBytes(b, off, len); buffer.doWrite(outputChunk, null); } @Override
@Override public void write(byte[] b, int off, int len) throws IOException { outputChunk.setBytes(b, off, len); buffer.doWrite(outputChunk, null); } @Override
public void write(int b) throws IOException { // Shouldn't get used for good performance, but is needed for // compatibility with Sun JDK 1.4.0 singleByteBuffer[0] = (byte) (b & 0xff); outputChunk.setBytes(singleByteBuffer, 0, 1); buffer.doWrite(outputChunk, null); } public void write(byte[] b, int off, int len)
@Override public void write(byte[] b, int off, int len) throws IOException { outputChunk.setBytes(b, off, len); buffer.doWrite(outputChunk, null); } @Override
/** Do a char->byte conversion. */ public void toBytes() { if( ! byteC.isNull() ) { type=T_BYTES; return; } toString(); type=T_BYTES; byte bb[] = strValue.getBytes(Charset.defaultCharset()); byteC.setBytes(bb, 0, bb.length); }
/** Do a char->byte conversion. */ public void toBytes() { if( ! byteC.isNull() ) { type=T_BYTES; return; } toString(); type=T_BYTES; byte bb[] = strValue.getBytes(Charset.defaultCharset()); byteC.setBytes(bb, 0, bb.length); }
/** Do a char->byte conversion. */ public void toBytes() { if( ! byteC.isNull() ) { type=T_BYTES; return; } toString(); type=T_BYTES; byte bb[] = strValue.getBytes(StandardCharsets.ISO_8859_1); byteC.setBytes(bb, 0, bb.length); }
/** Unimplemented yet. Do a char->byte conversion. */ public void toBytes() { if( ! byteC.isNull() ) { type=T_BYTES; return; } toString(); type=T_BYTES; byte bb[] = strValue.getBytes(); byteC.setBytes(bb, 0, bb.length); }
/** Unimplemented yet. Do a char->byte conversion. */ public void toBytes() { if( ! byteC.isNull() ) { type=T_BYTES; return; } toString(); type=T_BYTES; byte bb[] = strValue.getBytes(); byteC.setBytes(bb, 0, bb.length); }