Package java.io

Examples of java.io.DataInputStream.readShort()


        long modificationTime = 0;
        long blockSize = 0;
        name.readFields(in);
        // version 0 does not support per file replication
        if (!(imgVersion >= 0)) {
          replication = in.readShort(); // other versions do
          replication = FSEditLog.adjustReplication(replication);
        }
        if (imgVersion <= -5) {
          modificationTime = in.readLong();
        }
View Full Code Here


        ByteArrayInputStream bis = new ByteArrayInputStream(buf);
        DataInputStream      dis = new DataInputStream(bis);

        try {

        if ((sValue = dis.readShort()) != sMaxValue) {
            System.err.println("ERROR7 short " + sValue + "!=" + sMaxValue);
        }
        if ((iValue = dis.readInt()) != iMaxValue) {
            System.err.println("ERROR8 int " + iValue + "!=" + iMaxValue);
        }
View Full Code Here

        }
        if ((lValue = dis.readLong()) != lMaxValue) {
            System.err.println("ERROR9 long " + lValue + "!=" + lMaxValue);
        }

        if ((sValue = dis.readShort()) != sMinValue) {
            System.err.println("ERROR10 short " + sValue + "!=" + sMinValue);
        }
        if ((iValue = dis.readInt()) != iMinValue) {
            System.err.println("ERROR11 int " + iValue + "!=" + iMinValue);
        }
View Full Code Here

    protected boolean dirty = false;

    private void parseHeader(InputStream is) throws IOException {
        DataInputStream dis = new DataInputStream(is);

        version = dis.readShort();

        if (version > VERSION) {
            throw new IllegalStateException("Bad response format. " +
                "Check the tunnel servlet URL.");
        }
View Full Code Here

        if (version > VERSION) {
            throw new IllegalStateException("Bad response format. " +
                "Check the tunnel servlet URL.");
        }

        packetType = dis.readShort();
        packetSize = dis.readInt();
        connId = dis.readInt();
        sequence = dis.readInt();
        winsize = dis.readShort();
        reserved = dis.readShort();
View Full Code Here

        packetType = dis.readShort();
        packetSize = dis.readInt();
        connId = dis.readInt();
        sequence = dis.readInt();
        winsize = dis.readShort();
        reserved = dis.readShort();
        checksum = dis.readInt();
    }

    private void updateBuffers() throws IOException {
View Full Code Here

        packetType = dis.readShort();
        packetSize = dis.readInt();
        connId = dis.readInt();
        sequence = dis.readInt();
        winsize = dis.readShort();
        reserved = dis.readShort();
        checksum = dis.readInt();
    }

    private void updateBuffers() throws IOException {
        if (!dirty) {
View Full Code Here

   
   
    byte_order = dis.readByte();
    full_len = dis.readInt();
    serial = dis.readInt();
    package_type = dis.readShort();
    version = dis.readByte();
    make_sum = dis.readShort();
    data_len = htol(dis.readInt());
    dis.read(data, 0, data_len);
    System.out.println(String.format("%d,%d,%d", data[0], data[1], data[2]));
View Full Code Here

    byte_order = dis.readByte();
    full_len = dis.readInt();
    serial = dis.readInt();
    package_type = dis.readShort();
    version = dis.readByte();
    make_sum = dis.readShort();
    data_len = htol(dis.readInt());
    dis.read(data, 0, data_len);
    System.out.println(String.format("%d,%d,%d", data[0], data[1], data[2]));
   
  }
View Full Code Here

                    break;
                }
                case VoldemortOpCode.DELETE_OP_CODE: {
                    readKey(inputStream);

                    int versionSize = inputStream.readShort();
                    int newPosition = buffer.position() + versionSize;

                    if(newPosition > buffer.limit() || newPosition < 0)
                        throw new Exception("Data inconsistency on delete - versionSize: "
                                            + versionSize + ", position: " + buffer.position()
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.