Examples of FSTObjectOutput


Examples of org.nustaq.serialization.FSTObjectOutput

   
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
   
    try {
      if(useFst) {
        FSTObjectOutput out = fstConf.get().getObjectOutput(baos);
        out.writeObject(object);
      } else {
                getByteBuffer(object).position(0);
                getByteBuffer(object).putInt(9999);
                getByteBuffer(object).position(0);
                System.out.println("original object "+ extractFirstBufferField(object));
View Full Code Here

Examples of org.nustaq.serialization.FSTObjectOutput

    }

    public void writeObject(Object toWrite) throws Exception {
        try {
            while ( !writeLock.compareAndSet(false,true) );
            FSTObjectOutput objectOutput = conf.getObjectOutput(); // could also do new with minor perf impact
            objectOutput.writeObject(toWrite);

            int written = objectOutput.getWritten();
            out.write((written >>> 0) & 0xFF);
            out.write((written >>> 8) & 0xFF);
            out.write((written >>> 16) & 0xFF);
            out.write((written >>> 24) & 0xFF);

            out.write(objectOutput.getBuffer(), 0, written);
            objectOutput.flush();
        } finally {
            writeLock.set(false);
        }
    }
View Full Code Here

Examples of org.nustaq.serialization.FSTObjectOutput

  {
    Exception exception = null;

    try
    {
      FSTObjectOutput out = fastSerializationConfig.getObjectOutput();

      if (listener != null)
      {
        out.setListener(new ListenerAdapter(listener));
        listener.begin(object);
      }
      out.writeObject(object);
      out.setListener(null);

      return out.getCopyOfWrittenBuffer();
    }
    catch (Exception e)
    {
      exception = e;
      throw new Fast2WicketSerialException(String.format(
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.