org.modeshape.jcr.value.binary

## Class InMemoryBinaryValue

- java.lang.Object
- - org.modeshape.jcr.value.binary.AbstractBinary
  - - org.modeshape.jcr.value.binary.InMemoryBinaryValue

- All Implemented Interfaces:
    Serializable, Comparable<BinaryValue>, Binary, BinaryValue

      @Immutable
      public class InMemoryBinaryValue
      extends AbstractBinary

  An implementation of `BinaryValue` that keeps the binary data in-memory.
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class org.modeshape.jcr.value.binary.AbstractBinary

      `EMPTY_CONTENT`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `InMemoryBinaryValue(BinaryStore store, BinaryKey key, byte[] bytes)`
    `InMemoryBinaryValue(BinaryStore store, byte[] bytes)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `byte[]` | `getBytes()`
    `String` | `getMimeType()`
    `String` | `getMimeType(String name)`
    `long` | `getSize()` Get the length of this binary data.
    `protected InputStream` | `internalStream()`

    - ### Methods inherited from class org.modeshape.jcr.value.binary.AbstractBinary

      `compareTo, dispose, equals, getHash, getHexHash, getKey, getReadableSize, getStream, hashCode, keyFor, read, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### InMemoryBinaryValue

          public InMemoryBinaryValue(BinaryStore store,
                             byte[] bytes)

    - #### InMemoryBinaryValue

          public InMemoryBinaryValue(BinaryStore store,
                             BinaryKey key,
                             byte[] bytes)

  - ### Method Detail

    - #### getSize

          public long getSize()

      Description copied from interface: `BinaryValue`
      Get the length of this binary data.

      Note that this method, unlike the standard `Binary.getSize()` method, does not throw an exception.

      Returns:
        the number of bytes in this binary data

    - #### getBytes

          public byte[] getBytes()

    - #### getMimeType

          public String getMimeType()
                             throws IOException,
                                    RepositoryException

      Throws:
        `IOException`
        `RepositoryException`

    - #### getMimeType

          public String getMimeType(String name)
                             throws IOException,
                                    RepositoryException

      Throws:
        `IOException`
        `RepositoryException`

    - #### internalStream

          protected InputStream internalStream()

      Specified by:
        `internalStream` in class `AbstractBinary`

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.