Examples of readInt()


Examples of org.apache.accumulo.core.file.blockfile.ABlockReader.readInt()

    public Reader(BlockFileReader rdr) throws IOException {
      this.reader = rdr;
     
      ABlockReader mb = reader.getMetaBlock("RFile.index");
     
      int magic = mb.readInt();
      int ver = mb.readInt();
     
      if (magic != RINDEX_MAGIC)
        throw new IOException("Did not see expected magic number, saw " + magic);
      if (ver != RINDEX_VER_7 && ver != RINDEX_VER_6 && ver != RINDEX_VER_4 && ver != RINDEX_VER_3)
View Full Code Here

Examples of org.apache.activeio.packet.PacketData.readInt()

        data.writeInt(logFileOffset);
    }   

    static public Location readFromPacket(Packet packet) throws IOException {
        PacketData data = new PacketData(packet);
        return new Location(data.readInt(), data.readInt());
    }

    public static Location readFromDataInput(DataInput data) throws IOException {
        return new Location(data.readInt(), data.readInt());
    }
View Full Code Here

Examples of org.apache.activemq.command.ActiveMQBytesMessage.readInt()

    public void testReadInt() {
        ActiveMQBytesMessage msg = new ActiveMQBytesMessage();
        try {
            msg.writeInt(3000);
            msg.reset();
            assertTrue(msg.readInt() == 3000);
        } catch (JMSException jmsEx) {
            jmsEx.printStackTrace();
            assertTrue(false);
        }
    }
View Full Code Here

Examples of org.apache.activemq.command.ActiveMQStreamMessage.readInt()

                fail("Should have thrown exception");
            } catch (MessageFormatException mfe) {
            }
            msg.reset();
            try {
                msg.readInt();
                fail("Should have thrown exception");
            } catch (MessageFormatException mfe) {
            }
            msg.reset();
            try {
View Full Code Here

Examples of org.apache.activemq.util.DataByteArrayInputStream.readInt()

    final int XID_PREFIX_SIZE = 16;
    //+|-,(long)lastAck,(byte)priority,(int)formatid,(short)globalLength....
    private void initFromEncodedBytes() {
        DataByteArrayInputStream inputStream = new DataByteArrayInputStream(encodedXidBytes);
        inputStream.skipBytes(10);
        formatId = inputStream.readInt();
        int globalLength = inputStream.readShort();
        globalTransactionId = new byte[globalLength];
        try {
            inputStream.read(globalTransactionId);
            branchQualifier = new byte[inputStream.available()];
View Full Code Here

Examples of org.apache.avro.io.Decoder.readInt()

  @Test
  public void testDecodeInt() throws Exception {
    InputStream in = new ByteArrayInputStream(new byte[] { (byte) 0x00,
        (byte) 0x00, (byte) 0x00, (byte) 0x01});
    Decoder decoder = new ColumnDecoder(in);
    int i = decoder.readInt();
    assertEquals(1, i);

    in = new ByteArrayInputStream(new byte[] { (byte) 0xff, (byte) 0xff,
        (byte) 0xff, (byte) 0xff });
    decoder = new ColumnDecoder(in);
View Full Code Here

Examples of org.apache.axis2.context.externalize.SafeObjectInputStream.readInt()

        SafeObjectInputStream in = SafeObjectInputStream.install(inObject);
        // serialization version ID
        long suid = in.readLong();

        // revision ID
        int revID = in.readInt();

        // make sure the object data is in a version we can handle
        if (suid != serialVersionUID) {
            throw new ClassNotFoundException(ExternalizeConstants.UNSUPPORTED_SUID);
        }
View Full Code Here

Examples of org.apache.cassandra.io.BufferedRandomAccessFile.readInt()

        DecoratedKey decKey = sstable.getPartitioner().decorateKey(key);
        long position = sstable.getPosition(decKey);
        BufferedRandomAccessFile file = new BufferedRandomAccessFile(sstable.getFilename(), "r");
        file.seek(position);
        assert file.readUTF().equals(key);
        file.readInt();
        IndexHelper.skipBloomFilter(file);
        ArrayList<IndexHelper.IndexInfo> indexes = IndexHelper.deserializeIndex(file);
        assert indexes.size() > 2;
        validateSliceLarge(cfStore);
    }
View Full Code Here

Examples of org.apache.cassandra.io.DataInputBuffer.readInt()

    public static RangeSliceReply read(byte[] body) throws IOException
    {
        DataInputBuffer bufIn = new DataInputBuffer();
        bufIn.reset(body, body.length);
        boolean completed = bufIn.readBoolean();
        int rowCount = bufIn.readInt();
        List<Row> rows = new ArrayList<Row>(rowCount);
        for (int i = 0; i < rowCount; i++)
        {
            rows.add(Row.serializer().deserialize(bufIn));
        }
View Full Code Here

Examples of org.apache.cassandra.io.util.BufferedRandomAccessFile.readInt()

                    Checksum checksum = new CRC32();
                    int serializedSize;
                    try
                    {
                        // any of the reads may hit EOF
                        serializedSize = reader.readInt();
                        // RowMutation must be at LEAST 10 bytes:
                        // 3 each for a non-empty Table and Key (including the 2-byte length from
                        // writeUTF/writeWithShortLength) and 4 bytes for column count.
                        // This prevents CRC by being fooled by special-case garbage in the file; see CASSANDRA-2128
                        if (serializedSize < 10)
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.