/** * Get all data available from the buffer * @return */ public byte[] readAll() { synchronized (access) { int size = getAvailable(); byte[] result = new byte[size]; for( int i=0; i<size; i++) result[i] = (byte) get(); return result; } }
/** * Get all data available from the buffer * @return */ public byte[] readAll() { synchronized (access) { int size = getAvailable(); byte[] result = new byte[size]; for( int i=0; i<size; i++) result[i] = (byte) get(); return result; } }