use of org.apache.geode.internal.tcp.ByteBufferInputStream in project geode by apache.
the class ByteArrayData method getDataInputStream.
public DataInputStream getDataInputStream() {
ByteBuffer bb = ByteBuffer.wrap(this.baos.toByteArray());
ByteBufferInputStream bbis = new ByteBufferInputStream(bb);
return new DataInputStream(bbis);
}
use of org.apache.geode.internal.tcp.ByteBufferInputStream in project geode by apache.
the class PdxInstanceImpl method createDis.
private static PdxInputStream createDis(DataInput in, int len) {
PdxInputStream dis;
if (in instanceof PdxInputStream) {
dis = new PdxInputStream((ByteBufferInputStream) in, len);
try {
int bytesSkipped = in.skipBytes(len);
int bytesRemaining = len - bytesSkipped;
while (bytesRemaining > 0) {
in.readByte();
bytesRemaining--;
}
} catch (IOException ex) {
throw new PdxSerializationException("Could not deserialize PDX", ex);
}
} else {
byte[] bytes = new byte[len];
try {
in.readFully(bytes);
} catch (IOException ex) {
throw new PdxSerializationException("Could not deserialize PDX", ex);
}
dis = new PdxInputStream(bytes);
}
return dis;
}
use of org.apache.geode.internal.tcp.ByteBufferInputStream in project geode by apache.
the class ByteArrayData method getDataInput.
/**
* Returns a <code>DataInput</code> to read from
*/
public DataInput getDataInput() {
ByteBuffer bb = ByteBuffer.wrap(this.baos.toByteArray());
ByteBufferInputStream bbis = new ByteBufferInputStream(bb);
return bbis;
}
Aggregations