All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinispan.protostream.impl.ByteArrayOutputStreamEx Maven / Gradle / Ivy

Go to download

Users need to implement a marshaller object that interacts with a field writer/reader in order to serialize state.

There is a newer version: 14.0.0.CR2
Show newest version
package org.infinispan.protostream.impl;

import java.io.ByteArrayOutputStream;
import java.nio.ByteBuffer;

/**
 * Extends {@link java.io.ByteArrayOutputStream} and provides direct access to the internal buffer without making a copy.
 *
 * @author [email protected]
 * @since 4.0
 */
public final class ByteArrayOutputStreamEx extends ByteArrayOutputStream {

   public ByteArrayOutputStreamEx() {
   }

   public ByteArrayOutputStreamEx(int size) {
      super(size);
   }

   public synchronized ByteBuffer getByteBuffer() {
      return ByteBuffer.wrap(buf, 0, count);
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy