Class ExpandableMarshalledValueByteStream

java.lang.Object
java.io.OutputStream
org.infinispan.io.MarshalledValueByteStream
org.infinispan.io.ExpandableMarshalledValueByteStream
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable

@Deprecated(forRemoval=true) public final class ExpandableMarshalledValueByteStream extends MarshalledValueByteStream
Deprecated, for removal: This API element is subject to removal in a future version.
since 10.0
A byte stream that can be written to and expanded on the fly without having to allocate unnecessary byte arrays by not extending ByteArrayOutputStream.
Since:
5.1
Author:
Manik Surtani
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Default buffer size after which if more buffer capacity is needed the buffer will grow by 25% rather than 100%
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    ExpandableMarshalledValueByteStream(int size, int maxDoublingSize)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Creates a new byte array output stream, with a buffer capacity of the specified size, in bytes.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(Object thatObject)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    final int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the highest internal buffer size after which if more capacity is needed the buffer will grow in 25% increments rather than 100%.
    final int
    getNewBufferSize(int curSize, int minNewSize)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the number of bytes to which the internal buffer should be resized.
    final byte[]
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the internal buffer array.
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    final int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Overriden only to avoid unneeded synchronization
    final void
    write(byte[] b, int off, int len)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    final void
    write(int b)
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Methods inherited from class java.io.OutputStream

    close, flush, nullOutputStream, write

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DEFAULT_DOUBLING_SIZE

      public static final int DEFAULT_DOUBLING_SIZE
      Deprecated, for removal: This API element is subject to removal in a future version.
      Default buffer size after which if more buffer capacity is needed the buffer will grow by 25% rather than 100%
      See Also:
  • Constructor Details

    • ExpandableMarshalledValueByteStream

      public ExpandableMarshalledValueByteStream()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • ExpandableMarshalledValueByteStream

      public ExpandableMarshalledValueByteStream(int size)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • ExpandableMarshalledValueByteStream

      public ExpandableMarshalledValueByteStream(int size, int maxDoublingSize)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a new byte array output stream, with a buffer capacity of the specified size, in bytes.
      Parameters:
      size - the initial size.
      maxDoublingSize - the buffer size, after which if more capacity is needed the buffer will grow by 25% rather than 100%
      Throws:
      IllegalArgumentException - if size is negative.
  • Method Details

    • getRaw

      public final byte[] getRaw()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the internal buffer array. Note that the length of this array will almost certainly be longer than the data written to it; call size() to get the number of bytes of actual data.
      Specified by:
      getRaw in class MarshalledValueByteStream
    • write

      public final void write(byte[] b, int off, int len)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      write in class OutputStream
    • write

      public final void write(int b)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      write in class OutputStream
    • getMaxDoublingSize

      public final int getMaxDoublingSize()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the highest internal buffer size after which if more capacity is needed the buffer will grow in 25% increments rather than 100%.
    • getNewBufferSize

      public final int getNewBufferSize(int curSize, int minNewSize)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the number of bytes to which the internal buffer should be resized.
      Parameters:
      curSize - the current number of bytes
      minNewSize - the minimum number of bytes required
      Returns:
      the size to which the internal buffer should be resized
    • size

      public final int size()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overriden only to avoid unneeded synchronization
      Specified by:
      size in class MarshalledValueByteStream
    • equals

      public boolean equals(Object thatObject)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      hashCode in class Object