/** * re-start the input stream - reusing the current buffer * * @param size */ public void restart(int size) { if (buf == null || buf.length < size) { buf = new byte[size]; } restart(buf); this.length = size; }
/** * Creates a <code>StoreByteArrayInputStream</code>. * * @param buffer the input buffer. */ public DataByteArrayInputStream(Buffer buffer) { restart(buffer); }
/** * Creates a <code>StoreByteArrayInputStream</code>. * * @param buf the input buffer. */ public DataByteArrayInputStream(byte buf[]) { restart(buf); }
/** * Creates a <code>StoreByteArrayInputStream</code>. * * @param buf the input buffer. */ public DataByteArrayInputStream(byte buf[]) { restart(buf); }
/** * Creates a <code>StoreByteArrayInputStream</code>. * * @param buf the input buffer. */ public DataByteArrayInputStream(byte buf[]) { restart(buf); }
/** * re-start the input stream - reusing the current buffer * * @param size */ public void restart(int size) { if (buf == null || buf.length < size) { buf = new byte[size]; } restart(buf); this.length = size; }
/** * Creates a <code>StoreByteArrayInputStream</code>. * * @param buffer the input buffer. */ public DataByteArrayInputStream(Buffer buffer) { restart(buffer); }
/** * re-start the input stream - reusing the current buffer * * @param size */ public void restart(int size) { if (buf == null || buf.length < size) { buf = new byte[size]; } restart(buf); this.length = size; }
/** * Creates a <code>StoreByteArrayInputStream</code>. * * @param buffer the input buffer. */ public DataByteArrayInputStream(Buffer buffer) { restart(buffer); }
public synchronized Object unmarshal(Buffer sequence) throws IOException { bytesIn.restart(sequence); // DataByteArrayInputStreamStream dis = new DataByteArrayInputStreamStream(new // ByteArrayInputStream(sequence)); if (!sizePrefixDisabled) { int size = bytesIn.readInt(); if (sequence.getLength() - 4 != size) { // throw new IOException("Packet size does not match marshaled // size"); } if (size > maxFrameSize) { throw new IOException( "Frame size of " + (size / (1024 * 1024)) + " MB larger than max allowed " + (maxFrameSize / (1024 * 1024)) + " MB"); } } Object command = doUnmarshal(bytesIn); // if( !cacheEnabled && ((DataStructure)command).isMarshallAware() ) { // ((MarshallAware) command).setCachedMarshalledForm(this, sequence); // } return command; }
public synchronized Object unmarshal(Buffer sequence) throws IOException { bytesIn.restart(sequence); // DataByteArrayInputStreamStream dis = new DataByteArrayInputStreamStream(new // ByteArrayInputStream(sequence)); if (!sizePrefixDisabled) { int size = bytesIn.readInt(); if (sequence.getLength() - 4 != size) { // throw new IOException("Packet size does not match marshaled // size"); } if (size > maxFrameSize) { throw new IOException( "Frame size of " + (size / (1024 * 1024)) + " MB larger than max allowed " + (maxFrameSize / (1024 * 1024)) + " MB"); } } Object command = doUnmarshal(bytesIn); // if( !cacheEnabled && ((DataStructure)command).isMarshallAware() ) { // ((MarshallAware) command).setCachedMarshalledForm(this, sequence); // } return command; }