/** * @param in data input * @return An unsigned short in an integer. * @throws IOException if an I/O error occurs. */ public static ByteBuffer readWithShortLength(DataInput in) throws IOException { return ByteBufferUtil.read(in, readShortLength(in)); }
public static ByteBuffer readWithLength(DataInput in) throws IOException { int length = in.readInt(); if (length < 0) { throw new IOException("Corrupt (negative) value length encountered"); } return ByteBufferUtil.read(in, length); }
/** * @param in data input * @return An unsigned short in an integer. * @throws IOException if an I/O error occurs. */ public static ByteBuffer readWithShortLength(DataInput in) throws IOException { return ByteBufferUtil.read(in, readShortLength(in)); }
public static ByteBuffer readWithLength(DataInput in) throws IOException { int length = in.readInt(); if (length < 0) { throw new IOException("Corrupt (negative) value length encountered"); } return ByteBufferUtil.read(in, length); }
/** * @param in data input * @return An unsigned short in an integer. * @throws IOException if an I/O error occurs. */ public static ByteBuffer readWithShortLength(DataInput in) throws IOException { return ByteBufferUtil.read(in, readShortLength(in)); }
public static ByteBuffer readWithLength(DataInput in) throws IOException { int length = in.readInt(); if (length < 0) { throw new IOException("Corrupt (negative) value length encountered"); } return ByteBufferUtil.read(in, length); }
/** * @param in data input * @return An unsigned short in an integer. * @throws IOException if an I/O error occurs. */ public static ByteBuffer readWithShortLength(DataInput in) throws IOException { return ByteBufferUtil.read(in, readShortLength(in)); }
public static ByteBuffer readWithLength(DataInput in) throws IOException { int length = in.readInt(); if (length < 0) { throw new IOException("Corrupt (negative) value length encountered"); } return ByteBufferUtil.read(in, length); }
/** * @param in data input * @return An unsigned short in an integer. * @throws IOException if an I/O error occurs. */ public static ByteBuffer readWithShortLength(DataInput in) throws IOException { return ByteBufferUtil.read(in, readShortLength(in)); }
public static ByteBuffer readWithLength(DataInput in) throws IOException { int length = in.readInt(); if (length < 0) { throw new IOException("Corrupt (negative) value length encountered"); } return ByteBufferUtil.read(in, length); }
/** * @param in data input * @return An unsigned short in an integer. * @throws IOException if an I/O error occurs. */ public static ByteBuffer readWithShortLength(DataInput in) throws IOException { return ByteBufferUtil.read(in, readShortLength(in)); }
public static ByteBuffer readWithLength(DataInput in) throws IOException { int length = in.readInt(); if (length < 0) { throw new IOException("Corrupt (negative) value length encountered"); } return ByteBufferUtil.read(in, length); }
public static ByteBuffer readWithVIntLength(DataInputPlus in) throws IOException { int length = (int)in.readUnsignedVInt(); if (length < 0) throw new IOException("Corrupt (negative) value length encountered"); return ByteBufferUtil.read(in, length); }
public static ByteBuffer readWithVIntLength(DataInputPlus in) throws IOException { int length = (int)in.readUnsignedVInt(); if (length < 0) throw new IOException("Corrupt (negative) value length encountered"); return ByteBufferUtil.read(in, length); }
public static ByteBuffer readWithVIntLength(DataInputPlus in) throws IOException { int length = (int)in.readUnsignedVInt(); if (length < 0) throw new IOException("Corrupt (negative) value length encountered"); return ByteBufferUtil.read(in, length); }
public static ByteBuffer readWithVIntLength(DataInputPlus in) throws IOException { int length = (int)in.readUnsignedVInt(); if (length < 0) throw new IOException("Corrupt (negative) value length encountered"); return ByteBufferUtil.read(in, length); }
public static ByteBuffer readWithVIntLength(DataInputPlus in) throws IOException { int length = (int)in.readUnsignedVInt(); if (length < 0) throw new IOException("Corrupt (negative) value length encountered"); return ByteBufferUtil.read(in, length); }
public ByteBuffer readValue(DataInputPlus in, int maxValueSize) throws IOException { int length = valueLengthIfFixed(); if (length >= 0) return ByteBufferUtil.read(in, length); else { int l = (int)in.readUnsignedVInt(); if (l < 0) throw new IOException("Corrupt (negative) value length encountered"); if (l > maxValueSize) throw new IOException(String.format("Corrupt value length %d encountered, as it exceeds the maximum of %d, " + "which is set via max_value_size_in_mb in cassandra.yaml", l, maxValueSize)); return ByteBufferUtil.read(in, l); } }
private ByteBuffer readBuffer(int size) throws IOException { if (rateLimiter != null) rateLimiter.acquire(size); input.limit(size); ByteBuffer buffer = ByteBufferUtil.read(input, size); if (input.checkCrc()) return buffer; // log a warning and skip the corrupted entry logger.warn("Failed to read a hint for {} - digest mismatch for hint at position {} in file {}", descriptor.hostId, input.getPosition() - size - 4, descriptor.fileName()); return null; } }
private ByteBuffer readBuffer(int size) throws IOException { if (rateLimiter != null) rateLimiter.acquire(size); input.limit(size); ByteBuffer buffer = ByteBufferUtil.read(input, size); if (input.checkCrc()) return buffer; // log a warning and skip the corrupted entry logger.warn("Failed to read a hint for {} - digest mismatch for hint at position {} in file {}", descriptor.hostId, input.getPosition() - size - 4, descriptor.fileName()); return null; } }