public int read(final byte[] b, final int off, final int len) throws IOException { while (remaining == 0) { final int v = riverUnmarshaller.read(); if (v == -1) { return -1; } readBlockHeader(v); } final int remaining = this.remaining; if (remaining == -1) { return -1; } final int cnt = riverUnmarshaller.read(b, off, Math.min(remaining, len)); this.remaining = remaining - cnt; return cnt; }
public long skip(final long n) throws IOException { while (remaining == 0) { final int v = riverUnmarshaller.read(); if (v == -1) { return -1; } readBlockHeader(v); } final int remaining = this.remaining; if (remaining == -1) { return -1; } final int cnt = riverUnmarshaller.skipBytes((int)Math.min((long)remaining, n)); this.remaining = remaining - cnt; return cnt; }
public int skipBytes(final int n) throws IOException { while (remaining == 0) { final int v = riverUnmarshaller.read(); if (v == -1) { return -1; } readBlockHeader(v); } final int remaining = this.remaining; if (remaining == -1) { return -1; } final int cnt = riverUnmarshaller.skipBytes(Math.min(remaining, n)); this.remaining = remaining - cnt; return cnt; }
private Object readObject(boolean unshared) throws ClassNotFoundException, IOException { if (remaining > 0) { throw createOptionalDataException(remaining); } else if (remaining == -1) { throw createOptionalDataException(true); } final int leadByte = riverUnmarshaller.read(); if (leadByte == -1 || leadByte == Protocol.ID_END_BLOCK_DATA) { remaining = -1; throw createOptionalDataException(true); } return riverUnmarshaller.doReadObject(leadByte, unshared, false); }
void readToEndBlockData() throws IOException, ClassNotFoundException { for (;;) { while (remaining > 0) { skipBytes(remaining); } final int b = riverUnmarshaller.read(); switch (b) { case -1: remaining = -1; return; case Protocol.ID_END_BLOCK_DATA: remaining = -1; return; case Protocol.ID_START_BLOCK_SMALL: case Protocol.ID_START_BLOCK_MEDIUM: case Protocol.ID_START_BLOCK_LARGE: readBlockHeader(b); break; default: // consume object... or whatever riverUnmarshaller.doReadObject(b, false, true); break; } } }
public int read(final byte[] b, final int off, final int len) throws IOException { while (remaining == 0) { final int v = riverUnmarshaller.read(); if (v == -1) { return -1; } readBlockHeader(v); } final int remaining = this.remaining; if (remaining == -1) { return -1; } final int cnt = riverUnmarshaller.read(b, off, Math.min(remaining, len)); this.remaining = remaining - cnt; return cnt; }
public int skipBytes(final int n) throws IOException { while (remaining == 0) { final int v = riverUnmarshaller.read(); if (v == -1) { return -1; } readBlockHeader(v); } final int remaining = this.remaining; if (remaining == -1) { return -1; } final int cnt = riverUnmarshaller.skipBytes(Math.min(remaining, n)); this.remaining = remaining - cnt; return cnt; }
private Object readObject(boolean unshared) throws ClassNotFoundException, IOException { if (remaining > 0) { throw createOptionalDataException(remaining); } else if (remaining == -1) { throw createOptionalDataException(true); } final int leadByte = riverUnmarshaller.read(); if (leadByte == -1 || leadByte == Protocol.ID_END_BLOCK_DATA) { remaining = -1; throw createOptionalDataException(true); } return riverUnmarshaller.doReadObject(leadByte, unshared, false); }
private Object readObject(boolean unshared) throws ClassNotFoundException, IOException { if (remaining > 0) { throw createOptionalDataException(remaining); } else if (remaining == -1) { throw createOptionalDataException(true); } final int leadByte = riverUnmarshaller.read(); if (leadByte == -1 || leadByte == Protocol.ID_END_BLOCK_DATA) { remaining = -1; throw createOptionalDataException(true); } return riverUnmarshaller.doReadObject(leadByte, unshared, false); }
private Object readObject(boolean unshared) throws ClassNotFoundException, IOException { if (remaining > 0) { throw createOptionalDataException(remaining); } else if (remaining == -1) { throw createOptionalDataException(true); } final int leadByte = riverUnmarshaller.read(); if (leadByte == -1 || leadByte == Protocol.ID_END_BLOCK_DATA) { remaining = -1; throw createOptionalDataException(true); } return riverUnmarshaller.doReadObject(leadByte, unshared); }
private Object readObject(boolean unshared) throws ClassNotFoundException, IOException { if (remaining > 0) { throw createOptionalDataException(remaining); } else if (remaining == -1) { throw createOptionalDataException(true); } final int leadByte = riverUnmarshaller.read(); if (leadByte == -1 || leadByte == Protocol.ID_END_BLOCK_DATA) { remaining = -1; throw createOptionalDataException(true); } return riverUnmarshaller.doReadObject(leadByte, unshared, false); }
private Object readObject(boolean unshared) throws ClassNotFoundException, IOException { if (remaining > 0) { throw createOptionalDataException(remaining); } else if (remaining == -1) { throw createOptionalDataException(true); } final int leadByte = riverUnmarshaller.read(); if (leadByte == -1 || leadByte == Protocol.ID_END_BLOCK_DATA) { remaining = -1; throw createOptionalDataException(true); } return riverUnmarshaller.doReadObject(leadByte, unshared, false); }
private Object readObject(boolean unshared) throws ClassNotFoundException, IOException { if (remaining > 0) { throw createOptionalDataException(remaining); } else if (remaining == -1) { throw createOptionalDataException(true); } final int leadByte = riverUnmarshaller.read(); if (leadByte == -1 || leadByte == Protocol.ID_END_BLOCK_DATA) { remaining = -1; throw createOptionalDataException(true); } return riverUnmarshaller.doReadObject(leadByte, unshared, false); }