Code example for ByteArrayOutputStream

Methods: size

0
            socketOut.write(hex, cursor, 8 - cursor);
        } 
        private byte[] hex = new byte[8];
 
        private void sendCache(boolean close) throws IOException {
            int size = cache.size();
            if (size > 0 || close) {
                if (limit < 0) {
                    if (size > 0) {
                        writeHex(size);
                        socketOut.write(CRLF);
                        cache.writeTo(socketOut);
                        cache.reset();
                        socketOut.write(CRLF);
                    } 
                    if (close) {
                        socketOut.write(FINAL_CHUNK);
                    } 
                } 
            } 
        }