Package org.infinispan.commons.io

Examples of org.infinispan.commons.io.ByteBufferImpl$Externalizer


      private static final Charset DEFAULT_ENCODING = Charset.forName("UTF-8");

      @Override
      protected ByteBuffer objectToBuffer(Object o, int estimatedSize) {
         byte[] bytes = ((String) o).getBytes(DEFAULT_ENCODING);
         return new ByteBufferImpl(bytes, 0, bytes.length);
      }
View Full Code Here


   @Override
   protected ByteBuffer objectToBuffer(Object o, int estimatedSize) throws IOException {
      ExposedByteArrayOutputStream baos = new ExposedByteArrayOutputStream(estimatedSize);
      Encoder encoder = AVRO_ENCODER_FACTORY.directBinaryEncoder(baos, null);
      objectToBuffer(o, encoder);
      return new ByteBufferImpl(baos.getRawBuffer(), 0, baos.size());
   }
View Full Code Here

   }

   @Override
   protected ByteBuffer objectToBuffer(Object o, int estimatedSize) throws IOException, InterruptedException {
      byte[] bytes = ProtobufUtil.toWrappedByteArray(getSerializationContext(), o);
      return new ByteBufferImpl(bytes, 0, bytes.length);
   }
View Full Code Here

            throw ioe;
         }
      } finally {
         finishObjectOutput(out);
      }
      return new ByteBufferImpl(baos.getRawBuffer(), 0, baos.size());
   }
View Full Code Here

      private final Transcoder<Object> transcoder = new SerializingTranscoder();

      @Override
      protected ByteBuffer objectToBuffer(Object o, int estimatedSize) {
         CachedData encoded = transcoder.encode(o);
         return new ByteBufferImpl(encoded.getData(), 0, encoded.getData().length);
      }
View Full Code Here

TOP

Related Classes of org.infinispan.commons.io.ByteBufferImpl$Externalizer

Copyright © 2018 www.massapicom. 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.