Package java.io

Examples of java.io.DataInputStream.skip()


  public void readFromBytes(byte[] data) throws IOException, BrokerException {
    ByteArrayInputStream bais = new ByteArrayInputStream(data);
    DataInputStream dis = new DataInputStream(bais);

    dis.skip(2);
    String dest = dis.readUTF();
    destUID = new DestinationUID(dest);
    sysMessageID = new SysMessageID();
    sysMessageID.readID(dis);
 
View Full Code Here


          getPrefix() + "readFromBytes");
    }
    ByteArrayInputStream bais = new ByteArrayInputStream(data);
    DataInputStream dis = new DataInputStream(bais);
    clusterTransaction = new ClusterTransaction();
    dis.skip(2);
   

    clusterTransaction.getTransactionDetails().readContent(dis);
    if (Store.getDEBUG()) {
      Globals.getLogger().log(Logger.DEBUG,
View Full Code Here

  void readFromBytes(byte[] data) throws IOException, BrokerException {
    ByteArrayInputStream bais = new ByteArrayInputStream(data);
    DataInputStream dis = new DataInputStream(bais);

    clusterTransaction = new ClusterTransaction();
    dis.skip(2);
    clusterTransaction.getTransactionDetails().readContent(dis);

    dis.close();
    bais.close();
  }
View Full Code Here

  public void readFromBytes(byte[] data) throws IOException, BrokerException {
    ByteArrayInputStream bais = new ByteArrayInputStream(data);
    DataInputStream dis = new DataInputStream(bais);

    dis.skip(2);
    messageAck = new TransactionWorkMessageAck();
    messageAck.readWork(dis);

    dis.close();
    bais.close();
View Full Code Here

 
  public void readFromBytes(byte[] data) throws IOException, BrokerException {
    ByteArrayInputStream bais = new ByteArrayInputStream(data);
    DataInputStream dis = new DataInputStream(bais);
    remoteTransaction = new RemoteTransaction();
    dis.skip(2);

    remoteTransaction.getTransactionDetails().readContent(dis);
   
    int objectBodySize = dis.readInt();
View Full Code Here

        // skip fields...
        int numFields = dis.readShort();
        for (int i = 0; i < numFields; i++) {
            // 3 short: access flags, name index, descriptor index
            dis.skip(2 * 3);
            // attribute list...
            int attributes_count = dis.readUnsignedShort();
            for (int j = 0; j < attributes_count; j++) {
                dis.skipBytes(2); // skip attr_id (short)
                int len = dis.readInt();
View Full Code Here

        // skip fields...
        int numFields = dis.readShort();
        for (int i = 0; i < numFields; i++) {
            // 3 short: access flags, name index, descriptor index
            dis.skip(2 * 3);
            // attribute list...
            int attributes_count = dis.readUnsignedShort();
            for (int j = 0; j < attributes_count; j++) {
                dis.skipBytes(2); // skip attr_id (short)
                int len = dis.readInt();
View Full Code Here

  private void parse(byte[] header) throws IOException {
    /* Get input steam of bytes. */
    DataInputStream input = new DataInputStream(new ByteArrayInputStream(header));
   
    /* Skip OGG page header (length is always 0x1C in this case). */
    input.skip(0x1C);
   
    /* Read Spotify specific data. */
    if(input.read() == 0x81){
      while(input.available() >= 2){
        int blockSize = this.swap(input.readShort());
View Full Code Here

            int keyLength = WritableUtils.readVInt(input);
            int vIntKeyLength = WritableUtils.getVIntSize(keyLength);
            ImmutableBytesPtr ptr = new ImmutableBytesPtr(data, vIntKeyLength, keyLength);

            // value length
            input.skip(keyLength);
            int valueLength = WritableUtils.readVInt(input);
            int vIntValLength = WritableUtils.getVIntSize(keyLength);
            KeyValue keyValue =
                    KeyValueUtil.newKeyValue(ptr.get(), ptr.getOffset(), ptr.getLength(),
                        QueryConstants.SINGLE_COLUMN_FAMILY, QueryConstants.SINGLE_COLUMN,
View Full Code Here

            for (int i = 0; i < lastIndex; i++) {

                //dis.seek(recOffset[i]);
    dis.reset();
    dis.skip(recOffset[i]);
                len = recOffset[i+1] - recOffset[i];
                bytes = new byte[len];
                dis.readFully(bytes);
                recArray[i] = new Record(bytes, recAttrs[i]);
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.