Examples of writeInt()


Examples of be.bagofwords.util.WrappedSocketConnection.writeInt()

    private void valuesChangedForInterface(String interfaceName, long[] keys) {
        for (int i = 0; i < listenToChangesConnections.size(); i++) {
            WrappedSocketConnection connection = listenToChangesConnections.get(i);
            try {
                connection.writeString(interfaceName);
                connection.writeInt(keys.length);
                for (Long key : keys) {
                    connection.writeLong(key);
                }
                connection.flush();
                long response = connection.readLong();
View Full Code Here

Examples of bm.core.io.SerializerOutputStream.writeInt()

        catch( RecordStoreFullException e )
        {
            throw new RSException( 0, e );
        }
        final Store rs = index.getRecordStore();
        out.writeInt( index.getOrder() );
        out.writeByte( (byte) index.getType() );
        out.writeBoolean( index.isCaseSensitive() );
        numRecords = rs.getNumRecords();
        System.out.println( "Writing " + numRecords + " records" );
        out.writeInt( numRecords );
View Full Code Here

Examples of co.cask.cdap.common.io.BinaryEncoder.writeInt()

  @Override
  public byte[] encode(KeyIdentifier keyIdentifier) throws IOException {
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    Encoder encoder = new BinaryEncoder(bos);

    encoder.writeInt(KeyIdentifier.Schemas.getVersion());
    DatumWriter<KeyIdentifier> writer = writerFactory.create(KEY_IDENTIFIER_TYPE,
                                                             KeyIdentifier.Schemas.getCurrentSchema());
    writer.encode(keyIdentifier, encoder);
    return bos.toByteArray();
  }
View Full Code Here

Examples of co.cask.cdap.common.io.Encoder.writeInt()

  @Override
  public byte[] encode(KeyIdentifier keyIdentifier) throws IOException {
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    Encoder encoder = new BinaryEncoder(bos);

    encoder.writeInt(KeyIdentifier.Schemas.getVersion());
    DatumWriter<KeyIdentifier> writer = writerFactory.create(KEY_IDENTIFIER_TYPE,
                                                             KeyIdentifier.Schemas.getCurrentSchema());
    writer.encode(keyIdentifier, encoder);
    return bos.toByteArray();
  }
View Full Code Here

Examples of co.cask.tigon.io.BinaryEncoder.writeInt()

  private static byte[] serializeEmptyHashKeys() {
    try {
      // we don't synchronize here: the worst thing that go wrong here is repeated assignment to the same value
      ByteArrayOutputStream bos = new ByteArrayOutputStream();
      Encoder encoder = new BinaryEncoder(bos);
      encoder.writeInt(0);
      return bos.toByteArray();
    } catch (IOException e) {
      throw new RuntimeException("encoding empty hash keys went wrong - bailing out: " + e.getMessage(), e);
    }
  }
View Full Code Here

Examples of co.cask.tigon.io.Encoder.writeInt()

  private static byte[] serializeEmptyHashKeys() {
    try {
      // we don't synchronize here: the worst thing that go wrong here is repeated assignment to the same value
      ByteArrayOutputStream bos = new ByteArrayOutputStream();
      Encoder encoder = new BinaryEncoder(bos);
      encoder.writeInt(0);
      return bos.toByteArray();
    } catch (IOException e) {
      throw new RuntimeException("encoding empty hash keys went wrong - bailing out: " + e.getMessage(), e);
    }
  }
View Full Code Here

Examples of co.cask.tigon.sql.io.GDATEncoder.writeInt()

      switch(field.getType()) {
        case BOOL:
          encoder.writeBool(Boolean.parseBoolean(value));
          break;
        case INT:
          encoder.writeInt(Integer.valueOf(value));
          break;
        case LONG:
          encoder.writeLong(Long.valueOf(value));
          break;
        case DOUBLE:
View Full Code Here

Examples of codechicken.lib.packet.PacketCustom.writeInt()

        packet.writeByte(enabled.size());
        for (String s : enabled)
            packet.writeString(s);

        packet.writeInt(bannedItems.size());
        for (ItemStack stack : bannedItems)
            packet.writeItemStack(stack);

        packet.sendToPlayer(player);
    }
View Full Code Here

Examples of com.alibaba.dubbo.common.serialize.ObjectOutput.writeInt()

    }

    @Test
    public void test_Integer() throws Exception {
        ObjectOutput objectOutput = serialization.serialize(url, byteArrayOutputStream);
        objectOutput.writeInt(1);
        objectOutput.flushBuffer();

        ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(
                byteArrayOutputStream.toByteArray());
        ObjectInput deserialize = serialization.deserialize(url, byteArrayInputStream);
View Full Code Here

Examples of com.alibaba.fastjson.serializer.SerializeWriter.writeInt()

public class SerializeWriterTest extends TestCase {

  public void test_0() throws Exception {
    SerializeWriter writer = new SerializeWriter();
    writer.append('A');
    writer.writeInt(156);
    Assert.assertEquals("A156", writer.toString());
    writer.writeLong(345);
    Assert.assertEquals("A156345", writer.toString());

  }
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.