Class Slices

java.lang.Object
io.airlift.slice.Slices

public final class Slices extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Slice
    A slice with size 0.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Slice
    allocate(int capacity)
     
    static Slice
    allocateDirect(int capacity)
    Deprecated, for removal: This API element is subject to removal in a future version.
    static Slice
    copiedBuffer(String string, Charset charset)
     
    static Slice
    copyOf(Slice slice)
     
    static Slice
    copyOf(Slice slice, int offset, int length)
     
    static Slice
    ensureSize(Slice existingSlice, int minWritableBytes)
     
    static Slice
    Deprecated, for removal: This API element is subject to removal in a future version.
    static Slice
    utf8Slice(String string)
     
    static Slice
    wrappedBooleanArray(boolean... array)
    Deprecated, for removal: This API element is subject to removal in a future version.
    static Slice
    wrappedBooleanArray(boolean[] array, int offset, int length)
    Deprecated, for removal: This API element is subject to removal in a future version.
    static Slice
    wrappedBuffer(byte... array)
    Creates a slice over the specified array.
    static Slice
    wrappedBuffer(byte[] array, int offset, int length)
    Creates a slice over the specified array range.
    static Slice
    Deprecated, for removal: This API element is subject to removal in a future version.
    static Slice
    wrappedDoubleArray(double... array)
    Deprecated, for removal: This API element is subject to removal in a future version.
    static Slice
    wrappedDoubleArray(double[] array, int offset, int length)
    Deprecated, for removal: This API element is subject to removal in a future version.
    static Slice
    wrappedFloatArray(float... array)
    Deprecated, for removal: This API element is subject to removal in a future version.
    static Slice
    wrappedFloatArray(float[] array, int offset, int length)
    Deprecated, for removal: This API element is subject to removal in a future version.
    static Slice
     
    static Slice
    wrappedIntArray(int... array)
    Deprecated, for removal: This API element is subject to removal in a future version.
    static Slice
    wrappedIntArray(int[] array, int offset, int length)
    Deprecated, for removal: This API element is subject to removal in a future version.
    static Slice
    wrappedLongArray(long... array)
    Deprecated, for removal: This API element is subject to removal in a future version.
    static Slice
    wrappedLongArray(long[] array, int offset, int length)
    Deprecated, for removal: This API element is subject to removal in a future version.
    static Slice
    wrappedShortArray(short... array)
    Deprecated, for removal: This API element is subject to removal in a future version.
    static Slice
    wrappedShortArray(short[] array, int offset, int length)
    Deprecated, for removal: This API element is subject to removal in a future version.

    Methods inherited from class java.lang.Object

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

    • EMPTY_SLICE

      public static final Slice EMPTY_SLICE
      A slice with size 0.
  • Method Details

    • ensureSize

      public static Slice ensureSize(Slice existingSlice, int minWritableBytes)
    • allocate

      public static Slice allocate(int capacity)
    • allocateDirect

      @Deprecated(forRemoval=true) public static Slice allocateDirect(int capacity)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • copyOf

      public static Slice copyOf(Slice slice)
    • copyOf

      public static Slice copyOf(Slice slice, int offset, int length)
    • wrappedBuffer

      @Deprecated(forRemoval=true) public static Slice wrappedBuffer(ByteBuffer buffer)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Wrap the visible portion of a ByteBuffer.
    • wrappedHeapBuffer

      public static Slice wrappedHeapBuffer(ByteBuffer buffer)
    • wrappedBuffer

      public static Slice wrappedBuffer(byte... array)
      Creates a slice over the specified array.
    • wrappedBuffer

      public static Slice wrappedBuffer(byte[] array, int offset, int length)
      Creates a slice over the specified array range.
      Parameters:
      offset - the array position at which the slice begins
      length - the number of array positions to include in the slice
    • wrappedBooleanArray

      @Deprecated(forRemoval=true) public static Slice wrappedBooleanArray(boolean... array)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a slice over the specified array.
    • wrappedBooleanArray

      @Deprecated(forRemoval=true) public static Slice wrappedBooleanArray(boolean[] array, int offset, int length)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a slice over the specified array range.
      Parameters:
      offset - the array position at which the slice begins
      length - the number of array positions to include in the slice
    • wrappedShortArray

      @Deprecated(forRemoval=true) public static Slice wrappedShortArray(short... array)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a slice over the specified array.
    • wrappedShortArray

      @Deprecated(forRemoval=true) public static Slice wrappedShortArray(short[] array, int offset, int length)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a slice over the specified array range.
      Parameters:
      offset - the array position at which the slice begins
      length - the number of array positions to include in the slice
    • wrappedIntArray

      @Deprecated(forRemoval=true) public static Slice wrappedIntArray(int... array)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a slice over the specified array.
    • wrappedIntArray

      @Deprecated(forRemoval=true) public static Slice wrappedIntArray(int[] array, int offset, int length)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a slice over the specified array range.
      Parameters:
      offset - the array position at which the slice begins
      length - the number of array positions to include in the slice
    • wrappedLongArray

      @Deprecated(forRemoval=true) public static Slice wrappedLongArray(long... array)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a slice over the specified array.
    • wrappedLongArray

      @Deprecated(forRemoval=true) public static Slice wrappedLongArray(long[] array, int offset, int length)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a slice over the specified array range.
      Parameters:
      offset - the array position at which the slice begins
      length - the number of array positions to include in the slice
    • wrappedFloatArray

      @Deprecated(forRemoval=true) public static Slice wrappedFloatArray(float... array)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a slice over the specified array.
    • wrappedFloatArray

      @Deprecated(forRemoval=true) public static Slice wrappedFloatArray(float[] array, int offset, int length)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a slice over the specified array range.
      Parameters:
      offset - the array position at which the slice begins
      length - the number of array positions to include in the slice
    • wrappedDoubleArray

      @Deprecated(forRemoval=true) public static Slice wrappedDoubleArray(double... array)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a slice over the specified array.
    • wrappedDoubleArray

      @Deprecated(forRemoval=true) public static Slice wrappedDoubleArray(double[] array, int offset, int length)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a slice over the specified array range.
      Parameters:
      offset - the array position at which the slice begins
      length - the number of array positions to include in the slice
    • copiedBuffer

      public static Slice copiedBuffer(String string, Charset charset)
    • utf8Slice

      public static Slice utf8Slice(String string)
    • mapFileReadOnly

      @Deprecated(forRemoval=true) public static Slice mapFileReadOnly(File file) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      IOException