TcpBufferedOutputStream outputStream = new TcpBufferedOutputStream(socket.getOutputStream(), ioBufferSize); this.dataOut = new DataOutputStream(outputStream); this.buffOut = outputStream;
/** * write a byte on to the stream * * @param b - byte to write * @throws IOException */ public void write(int b) throws IOException { if ((bufferlen - count) < 1) { flush(); } buffer[count++] = (byte)b; }
/** * write a byte array to the stream * * @param b the byte buffer * @param off the offset into the buffer * @param len the length of data to write * @throws IOException */ public void write(byte b[], int off, int len) throws IOException { if (b != null) { if ((bufferlen - count) < len) { flush(); } if (buffer.length >= len) { System.arraycopy(b, off, buffer, count, len); count += len; } else { try { writeTimestamp = System.currentTimeMillis(); out.write(b, off, len); } finally { writeTimestamp = -1; } } } }
protected void initializeStreams() throws Exception { TcpBufferedInputStream buffIn = new TcpBufferedInputStream(socket.getInputStream(), ioBufferSize) { @Override public int read() throws IOException { receiveCounter++; return super.read(); } @Override public int read(byte[] b, int off, int len) throws IOException { receiveCounter++; return super.read(b, off, len); } @Override public long skip(long n) throws IOException { receiveCounter++; return super.skip(n); } @Override protected void fill() throws IOException { receiveCounter++; super.fill(); } }; this.dataIn = new DataInputStream(buffIn); TcpBufferedOutputStream outputStream = new TcpBufferedOutputStream(socket.getOutputStream(), ioBufferSize); this.dataOut = new DataOutputStream(outputStream); this.buffOut = outputStream; }
/** * write a byte on to the stream * * @param b - byte to write * @throws IOException */ public void write(int b) throws IOException { if ((bufferlen - count) < 1) { flush(); } buffer[count++] = (byte)b; }
TcpBufferedOutputStream outputStream = new TcpBufferedOutputStream(socket.getOutputStream(), ioBufferSize); this.dataOut = new DataOutputStream(outputStream); this.buffOut = outputStream;
/** * write a byte on to the stream * * @param b - byte to write * @throws IOException */ public void write(int b) throws IOException { if ((bufferlen - count) < 1) { flush(); } buffer[count++] = (byte)b; }
TcpBufferedOutputStream outputStream = new TcpBufferedOutputStream(socket.getOutputStream(), ioBufferSize); this.dataOut = new DataOutputStream(outputStream); this.buffOut = outputStream;
/** * write a byte on to the stream * * @param b - byte to write * @throws IOException */ public void write(int b) throws IOException { if ((bufferlen - count) < 1) { flush(); } buffer[count++] = (byte)b; }
outputStream = new TcpBufferedOutputStream(socket.getOutputStream(), 16 * 1024);
/** * write a byte on to the stream * * @param b - byte to write * @throws IOException */ public void write(int b) throws IOException { if ((bufferlen - count) < 1) { flush(); } buffer[count++] = (byte)b; }
TcpBufferedOutputStream outputStream = new TcpBufferedOutputStream(socket.getOutputStream(), ioBufferSize); this.dataOut = new DataOutputStream(outputStream); this.buffOut = outputStream;
/** * write a byte array to the stream * * @param b the byte buffer * @param off the offset into the buffer * @param len the length of data to write * @throws IOException */ public void write(byte b[], int off, int len) throws IOException { if (b != null) { if ((bufferlen - count) < len) { flush(); } if (buffer.length >= len) { System.arraycopy(b, off, buffer, count, len); count += len; } else { try { writeTimestamp = System.currentTimeMillis(); out.write(b, off, len); } finally { writeTimestamp = -1; } } } }
/** * write a byte array to the stream * * @param b the byte buffer * @param off the offset into the buffer * @param len the length of data to write * @throws IOException */ public void write(byte b[], int off, int len) throws IOException { if (b != null) { if ((bufferlen - count) < len) { flush(); } if (buffer.length >= len) { System.arraycopy(b, off, buffer, count, len); count += len; } else { try { writeTimestamp = System.currentTimeMillis(); out.write(b, off, len); } finally { writeTimestamp = -1; } } } }
/** * write a byte array to the stream * * @param b the byte buffer * @param off the offset into the buffer * @param len the length of data to write * @throws IOException */ public void write(byte b[], int off, int len) throws IOException { if (b != null) { if ((bufferlen - count) < len) { flush(); } if (buffer.length >= len) { System.arraycopy(b, off, buffer, count, len); count += len; } else { try { writeTimestamp = System.currentTimeMillis(); out.write(b, off, len); } finally { writeTimestamp = -1; } } } }
/** * write a byte array to the stream * * @param b the byte buffer * @param off the offset into the buffer * @param len the length of data to write * @throws IOException */ public void write(byte b[], int off, int len) throws IOException { if (b != null) { if ((bufferlen - count) < len) { flush(); } if (buffer.length >= len) { System.arraycopy(b, off, buffer, count, len); count += len; } else { try { writeTimestamp = System.currentTimeMillis(); out.write(b, off, len); } finally { writeTimestamp = -1; } } } }