public static int readIntCompressed(byte[] buf, int offset) { byte len=buf[offset++]; if(len == 0) return 0; byte[] buffer=new byte[len]; for(int i=0; i < len; i++) buffer[i]=buf[offset++]; return makeInt(buffer, 0, len); }
public static int readIntCompressed(byte[] buf, int offset) { byte len=buf[offset++]; if(len == 0) return 0; byte[] buffer=new byte[len]; for(int i=0; i < len; i++) buffer[i]=buf[offset++]; return makeInt(buffer, 0, len); }
public static int readIntCompressed(byte[] buf, int offset) { byte len=buf[offset++]; if(len == 0) return 0; byte[] buffer=new byte[len]; for(int i=0; i < len; i++) buffer[i]=buf[offset++]; return makeInt(buffer, 0, len); }
/** * Reads an int from an input stream * @param in the input stream * @return the int read from the input stream */ public static int readInt(DataInput in) throws IOException { byte len=in.readByte(); if(len == 0) return 0; byte[] buf=new byte[len]; in.readFully(buf, 0, len); return makeInt(buf, 0, len); }
/** * Reads an int from a buffer. * @param buf the buffer * @return the int read from the buffer */ public static int readInt(ByteBuffer buf) { byte len=buf.get(); if(len == 0) return 0; byte[] retval=new byte[len]; buf.get(retval, 0, len); return makeInt(retval, 0, len); }
/** * Reads an int from a buffer. * @param buf the buffer * @return the int read from the buffer */ public static int readInt(ByteBuffer buf) { byte len=buf.get(); if(len == 0) return 0; byte[] retval=new byte[len]; buf.get(retval, 0, len); return makeInt(retval, 0, len); }
/** * Reads an int from a buffer. * @param buf the buffer * @return the int read from the buffer */ public static int readInt(ByteBuffer buf) { byte len=buf.get(); if(len == 0) return 0; byte[] retval=new byte[len]; buf.get(retval, 0, len); return makeInt(retval, 0, len); }
/** * Reads an int from an input stream * @param in the input stream * @return the int read from the input stream */ public static int readInt(DataInput in) throws IOException { byte len=in.readByte(); if(len == 0) return 0; byte[] buf=new byte[len]; in.readFully(buf, 0, len); return makeInt(buf, 0, len); }
/** * Reads an int from an input stream * @param in the input stream * @return the int read from the input stream */ public static int readInt(DataInput in) throws IOException { byte len=in.readByte(); if(len == 0) return 0; byte[] buf=new byte[len]; in.readFully(buf, 0, len); return makeInt(buf, 0, len); }