/** Reads a single byte as an int from 0 to 255, or -1 if there are no more bytes are available. */ public int read () throws KryoException { if (optional(1) <= 0) return -1; return buffer[position++] & 0xFF; }
/** Reads a single byte as an int from 0 to 255, or -1 if there are no more bytes are available. */ public int read () throws KryoException { if (optional(1) <= 0) return -1; return buffer[position++] & 0xFF; }
/** Reads a single byte as an int from 0 to 255, or -1 if there are no more bytes are available. */ public int read () throws KryoException { if (optional(1) <= 0) return -1; return buffer[position++] & 0xFF; }
/** Reads a single byte as an int from 0 to 255, or -1 if there are no more bytes are available. */ public int read () throws KryoException { if (optional(1) <= 0) return -1; return buffer[position++] & 0xFF; }
public boolean eof () { return optional(1) <= 0; }
public boolean eof () { return optional(1) <= 0; }
public boolean eof () { return optional(1) <= 0; }
/** Returns true if enough bytes are available to read an int with {@link #readInt(boolean)}. */ public boolean canReadInt () throws KryoException { if (limit - position >= 5) return true; if (optional(5) <= 0) return false; int p = position; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; return true; }
/** Returns true if enough bytes are available to read an int with {@link #readInt(boolean)}. */ public boolean canReadInt () throws KryoException { if (limit - position >= 5) return true; if (optional(5) <= 0) return false; int p = position; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; return true; }
public boolean eof () { return optional(1) <= 0; }
/** Returns true if enough bytes are available to read an int with {@link #readInt(boolean)}. */ public boolean canReadInt () throws KryoException { if (limit - position >= 5) return true; if (optional(5) <= 0) return false; int p = position; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; return true; }
/** Returns true if enough bytes are available to read an int with {@link #readInt(boolean)}. */ public boolean canReadInt () throws KryoException { if (limit - position >= 5) return true; if (optional(5) <= 0) return false; int p = position; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; return true; }
/** Returns true if enough bytes are available to read a long with {@link #readLong(boolean)}. */ public boolean canReadLong () throws KryoException { if (limit - position >= 9) return true; if (optional(5) <= 0) return false; int p = position; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; return true; }
/** Returns true if enough bytes are available to read a long with {@link #readLong(boolean)}. */ public boolean canReadLong () throws KryoException { if (limit - position >= 9) return true; if (optional(5) <= 0) return false; int p = position; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; return true; }
/** Returns true if enough bytes are available to read a long with {@link #readLong(boolean)}. */ public boolean canReadLong () throws KryoException { if (limit - position >= 9) return true; if (optional(5) <= 0) return false; int p = position; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; return true; }
/** Returns true if enough bytes are available to read a long with {@link #readLong(boolean)}. */ public boolean canReadLong () throws KryoException { if (limit - position >= 9) return true; if (optional(5) <= 0) return false; int p = position; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; if ((buffer[p++] & 0x80) == 0) return true; if (p == limit) return false; return true; }
/** Reads count bytes or less and writes them to the specified byte[], starting at offset, and returns the number of bytes read * or -1 if no more bytes are available. */ public int read (byte[] bytes, int offset, int count) throws KryoException { if (bytes == null) throw new IllegalArgumentException("bytes cannot be null."); int startingCount = count; int copyCount = Math.min(limit - position, count); while (true) { System.arraycopy(buffer, position, bytes, offset, copyCount); position += copyCount; count -= copyCount; if (count == 0) break; offset += copyCount; copyCount = optional(count); if (copyCount == -1) { // End of data. if (startingCount == count) return -1; break; } if (position == limit) break; } return startingCount - count; }
/** Reads count bytes or less and writes them to the specified byte[], starting at offset, and returns the number of bytes read * or -1 if no more bytes are available. */ public int read (byte[] bytes, int offset, int count) throws KryoException { if (bytes == null) throw new IllegalArgumentException("bytes cannot be null."); int startingCount = count; int copyCount = Math.min(limit - position, count); while (true) { System.arraycopy(buffer, position, bytes, offset, copyCount); position += copyCount; count -= copyCount; if (count == 0) break; offset += copyCount; copyCount = optional(count); if (copyCount == -1) { // End of data. if (startingCount == count) return -1; break; } if (position == limit) break; } return startingCount - count; }
/** Reads count bytes or less and writes them to the specified byte[], starting at offset, and returns the number of bytes read * or -1 if no more bytes are available. */ public int read (byte[] bytes, int offset, int count) throws KryoException { if (bytes == null) throw new IllegalArgumentException("bytes cannot be null."); int startingCount = count; int copyCount = Math.min(limit - position, count); while (true) { System.arraycopy(buffer, position, bytes, offset, copyCount); position += copyCount; count -= copyCount; if (count == 0) break; offset += copyCount; copyCount = optional(count); if (copyCount == -1) { // End of data. if (startingCount == count) return -1; break; } if (position == limit) break; } return startingCount - count; }
/** Reads count bytes or less and writes them to the specified byte[], starting at offset, and returns the number of bytes read * or -1 if no more bytes are available. */ public int read (byte[] bytes, int offset, int count) throws KryoException { if (bytes == null) throw new IllegalArgumentException("bytes cannot be null."); int startingCount = count; int copyCount = Math.min(limit - position, count); while (true) { System.arraycopy(buffer, position, bytes, offset, copyCount); position += copyCount; count -= copyCount; if (count == 0) break; offset += copyCount; copyCount = optional(count); if (copyCount == -1) { // End of data. if (startingCount == count) return -1; break; } if (position == limit) break; } return startingCount - count; }