Examples of toBytes()


Examples of org.bitbucket.ouyi.conv.test.ConvTestTest.toBytes()

   
    ConvTestTest testObject = new ConvTestTest(13);
   
    ByteBuffer b = ByteBuffer.allocate(testObject.byteSize());
   
    testObject.toBytes(b);
   
    b.flip();
   
    ConvTestTest testObject2 = (ConvTestTest) Convertibles.fromBytes(b);
   
View Full Code Here

Examples of org.chaidb.db.index.Key.toBytes()

            newPage.lowerBound += 2;
        }
        newPage.setLowerBound(newPage.lowerBound);
        newPage.setUpperBound(newPage.upperBound);
        if (Debug.DEBUG_BTREEPAGE)
            logger.debug("m= " + m + " V'= " + new String(newKey.toBytes())); //Modified by ben at Aug, 12, 2002 Pending
        // remove from the current page
        if (m < order) {
            byte[] tmp = new byte[m * btreeSpec.getLeafNodeSize()];
            byte[] ptr = new byte[m * 2];
            int k = 0;
View Full Code Here

Examples of org.codehaus.activemq.service.impl.XATransactionCommand.toBytes()

    }

    private byte[] asBytes(Transaction transaction) throws IOException, JMSException {
        if (transaction instanceof XATransactionCommand) {
            XATransactionCommand packetTask = (XATransactionCommand) transaction;
            return packetTask.toBytes();
        }
        else {
            throw new IOException("Unsupported transaction type: " + transaction);
        }
    }
View Full Code Here

Examples of org.elasticsearch.common.bytes.BytesArray.toBytes()

        Channels.readFromFileChannel(fileChannel, offsetToRead, readBytes, offset + offsetToRead, lengthToRead);

        BytesReference source = new BytesArray(randomBytes, offset + offsetToRead, lengthToRead);
        BytesReference read = new BytesArray(readBytes, offset + offsetToRead, lengthToRead);

        assertThat("read bytes didn't match written bytes", source.toBytes(), Matchers.equalTo(read.toBytes()));
    }

    @Test(expected = EOFException.class)
    public void testBufferReadPastEOFWithException() throws Exception {
        int bytesToWrite = randomIntBetween(0, randomBytes.length - 1);
View Full Code Here

Examples of org.elasticsearch.common.bytes.BytesReference.toBytes()

    initMocks(this);
    BytesReference bytesReference = mock(BytesReference.class);
    BytesStream bytesStream = mock(BytesStream.class);

    when(nameBuilder.getIndexName(any(Event.class))).thenReturn("foo_index");
    when(bytesReference.toBytes()).thenReturn("{\"body\":\"test\"}".getBytes());
    when(bytesStream.bytes()).thenReturn(bytesReference);
    when(serializer.getContentBuilder(any(Event.class)))
        .thenReturn(bytesStream);
    when(elasticSearchClient.prepareIndex(anyString(), anyString()))
        .thenReturn(indexRequestBuilder);
View Full Code Here

Examples of org.jruby.pg.internal.messages.PasswordMessage.toBytes()

        processMessage();
        state = state.nextState(currentInMessage.getMessage().getType());

        if (state == ConnectionState.SendingAuthentication) {
          PasswordMessage message = createPasswordMessage(currentInMessage.getMessage());
          currentOutBuffer = message.toBytes();
        }
        currentInMessage = new ProtocolMessageBuffer();
      }
    }
View Full Code Here

Examples of org.kiji.schema.hbase.KijiManagedHBaseTableName.toBytes()

    LOG.debug("Reading existing HBase schema");
    final KijiManagedHBaseTableName hbaseTableName =
        KijiManagedHBaseTableName.getKijiTableName(mURI.getInstance(), tableName);
    HTableDescriptor currentTableDescriptor = null;
    byte[] tableNameAsBytes = hbaseTableName.toBytes();
    try {
      currentTableDescriptor = getHBaseAdmin().getTableDescriptor(tableNameAsBytes);
    } catch (TableNotFoundException tnfe) {
      if (!dryRun) {
        throw tnfe; // Not in dry-run mode; table needs to exist. Rethrow exception.
View Full Code Here

Examples of org.lilyproject.repository.api.AbsoluteRecordId.toBytes()

    private final IdGenerator idGenerator = new IdGeneratorImpl();

    @Test
    public void testSerializationRoundTrip() {
        AbsoluteRecordId id = new AbsoluteRecordIdImpl("mytable", idGenerator.fromString("USER.myId"));
        byte[] bytes = id.toBytes();
        AbsoluteRecordId deserialized = AbsoluteRecordIdImpl.fromBytes(bytes, idGenerator);

        assertEquals(id, deserialized);
    }
View Full Code Here

Examples of org.lilyproject.repository.api.RecordId.toBytes()

            RecordId recordId = record.getId();
            if (recordId == null) {
                recordId = idGenerator.newRecordId();
            }

            byte[] rowId = recordId.toBytes();

            try {
                FieldTypes fieldTypes = typeManager.getFieldTypesSnapshot();

                long version = 1L;
View Full Code Here

Examples of org.lilyproject.repository.api.ValueType.toBytes()

                if (condition.getValue() != null) {
                    ValueType valueType = fieldType.getValueType();
                    avroCond.setValueType(valueType.getName());

                    byte[] value = valueType.toBytes(condition.getValue(), parentRecords);
                    avroCond.setValue(ByteBuffer.wrap(value));
                }
                avroCond.setOperator(convert(condition.getOp()));
                avroCond.setAllowMissing(condition.getAllowMissing());
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.