/** * Reads the next byte of data from this input stream. The value byte is returned as an * <code>int</code> in the range <code>0</code> to <code>255</code>. If no byte is available * because the end of the stream has been reached, the value <code>-1</code> is returned. <p> * This <code>read</code> method cannot block. * * @return the next byte of data, or <code>-1</code> if the end of the stream has been reached. */ public int read() { return (_position < _count) ? readUnsignedByte() : -1; }
/** * Creates a <code>ByteArrayInputStream</code> so that it uses <code>buffer</code> as its * buffer array. The buffer array is not copied. The initial value of <code>pos</code> is * <code>0</code> and the initial value of <code>count</code> is the length of * <code>buffer</code>. * * @param buffer the input buffer. */ public OptimizedByteArrayInputStream(byte buffer[]) { setBuffer(buffer); }
os.close(); byte[] bytes = baos.toByteArray(); OptimizedByteArrayInputStream bais = new OptimizedByteArrayInputStream(bytes); byte flags = bais.readByte(); InputStream is = bais; if (isGzip(flags)) {
ObjectInputStream os = new MarshalInputStream(new OptimizedByteArrayInputStream(registrarBytes), Thread.currentThread().getContextClassLoader(), false, null, Collections.EMPTY_SET); return (ServiceRegistrar) os.readObject(); } finally {
OptimizedByteArrayInputStream bin = new OptimizedByteArrayInputStream(objBytes); byte bflags = bin.readByte(); InputStream bis = bin; if (isGzip(bflags)) { (locBytes == null ? null : new OptimizedByteArrayInputStream(locBytes)); InputStream lis = lin; if (lin != null) { byte flags = lin.readByte(); if (isGzip(flags)) { lis = new GZIPInputStream(lis);
context = Collections.EMPTY_SET; ObjectInputStream os = new MarshalInputStream(new OptimizedByteArrayInputStream(registrarBytes), defaultLoader, false, null, context); ServiceRegistrar reg = (ServiceRegistrar) os.readObject();
os.close(); byte[] bytes = baos.toByteArray(); OptimizedByteArrayInputStream bais = new OptimizedByteArrayInputStream(bytes); byte flags = bais.readByte(); InputStream is = bais; if (isGzip(flags)) {