public Bytes limit(long limit) { return wrapped.limit(limit); }
public long limit() { return wrapped.limit(); }
public long limit() { return wrapped.limit(); }
public Bytes limit(long limit) { return wrapped.limit(limit); }
public Bytes limit(long limit) { this.checkNotClosed(); return this.bytes.limit(limit); }
public long limit() { this.checkNotClosed(); return this.bytes.limit(); }
public long limit() { this.checkNotClosed(); return this.bytes.limit(); }
public Bytes limit(long limit) { this.checkNotClosed(); return this.bytes.limit(limit); }
private void check(@NotNull net.openhft.lang.io.Bytes b) { if (b.position() != 0) throw new AssertionError(); if (b.remaining() != b.limit()) throw new AssertionError(); for (long i = 0; i < 16 && i < b.limit(); i++) { int ch = b.readByte(i); if (ch < ' ') throw new AssertionError("Char " + ch); } if (b.limit() > 32) for (long i = b.limit() - 16; i < b.limit(); i++) { int ch = b.readByte(i); if (ch < ' ') throw new AssertionError("Char " + ch); } }
@Override public long hash(Bytes bytes) { return hash(bytes, bytes.position(), bytes.limit()); } }
@Override public long hash(Bytes bytes) { return hash(bytes, bytes.position(), bytes.limit()); } }
public long hash(Bytes bytes) { return hash(bytes, bytes.position(), bytes.limit()); }
public long hash(Bytes bytes) { return hash(bytes, bytes.position(), bytes.limit()); }
@Override public <T> T readSerializable(@NotNull Bytes bytes, Class<T> expectedClass, T object) throws IOException, ClassNotFoundException { long length = bytes.readUnsignedInt(); if (length < 8 || length > Integer.MAX_VALUE) throw new StreamCorruptedException("length = " + Long.toHexString(length)); long end = bytes.position() + length; long lim = bytes.limit(); bytes.limit(end); int magic = bytes.readUnsignedShort(bytes.position()); InputStream in = bytes.inputStream(); switch (magic) { case 0xEDAC: break; case 0x9c78: in = new InflaterInputStream(in); break; default: throw new StreamCorruptedException("Unknown magic number " + Integer.toHexString(magic)); } T t = (T) new ObjectInputStream(in).readObject(); bytes.limit(lim); if (end != bytes.position()) { bytes.position(end); } return t; } }
@Override public <T> T readSerializable(@NotNull Bytes bytes, Class<T> expectedClass, T object) throws IOException, ClassNotFoundException { long length = bytes.readUnsignedInt(); if (length < 8 || length > Integer.MAX_VALUE) throw new StreamCorruptedException("length = " + Long.toHexString(length)); long end = bytes.position() + length; long lim = bytes.limit(); bytes.limit(end); int magic = bytes.readUnsignedShort(bytes.position()); InputStream in = bytes.inputStream(); switch (magic) { case 0xEDAC: break; case 0x9c78: in = new InflaterInputStream(in); break; default: throw new StreamCorruptedException("Unknown magic number " + Integer.toHexString(magic)); } T t = (T) new ObjectInputStream(in).readObject(); bytes.limit(lim); if (end != bytes.position()) { System.out.println("diff: " + (end - bytes.position())); bytes.position(end); } return t; } }
db.limit(dbb.limit()); while (db.remaining() > 0) chars[pos++] = (char) db.readStopBit();