test_class.file: modules/core/src/test/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStreamTest.java
test_class.identifier: BinaryAbstractOutputStreamTest
test_class.superclass: extends GridCommonAbstractTest
test_case.body: @Test
      public void testCapacity() {
          assertEquals(256, BinaryAbstractOutputStream.capacity(0, 1));
  
          assertEquals(256, BinaryAbstractOutputStream.capacity(256, 1));
  
          assertEquals(256, BinaryAbstractOutputStream.capacity(256, 256));
  
          assertEquals(512, BinaryAbstractOutputStream.capacity(256, 257));
  
          assertEquals(512, BinaryAbstractOutputStream.capacity(512, 256));
  
          assertEquals(1024, BinaryAbstractOutputStream.capacity(512, 513));
  
          assertEquals(2048, BinaryAbstractOutputStream.capacity(1024, 1025));
  
          assertEquals(4096, BinaryAbstractOutputStream.capacity(2048, 2049));
  
          assertEquals(8192, BinaryAbstractOutputStream.capacity(4096, 4097));
  
          assertEquals(16384, BinaryAbstractOutputStream.capacity(8192, 8193));
  
          assertEquals(32768, BinaryAbstractOutputStream.capacity(16384, 16385));
  
          assertEquals(65536, BinaryAbstractOutputStream.capacity(32768, 32769));
  
          assertEquals(131072, BinaryAbstractOutputStream.capacity(65536, 65537));
  
          assertEquals(262144, BinaryAbstractOutputStream.capacity(131072, 131073));
  
          assertEquals(524288, BinaryAbstractOutputStream.capacity(262144, 262145));
  
          assertEquals(1048576, BinaryAbstractOutputStream.capacity(524288, 524289));
  
          assertEquals(2097152, BinaryAbstractOutputStream.capacity(1048576, 1048577));
  
          assertEquals(4194304, BinaryAbstractOutputStream.capacity(2097152, 2097153));
  
          assertEquals(8388608, BinaryAbstractOutputStream.capacity(4194304, 4194305));
  
          assertEquals(16777216, BinaryAbstractOutputStream.capacity(8388608, 8388609));
  
          assertEquals(33554432, BinaryAbstractOutputStream.capacity(16777216, 16777217));
  
          assertEquals(67108864, BinaryAbstractOutputStream.capacity(33554432, 33554433));
  
          assertEquals(134217728, BinaryAbstractOutputStream.capacity(67108864, 67108865));
  
          assertEquals(268435456, BinaryAbstractOutputStream.capacity(134217728, 134217729));
  
          assertEquals(536870912, BinaryAbstractOutputStream.capacity(268435456, 268435457));
  
          assertEquals(1073741824, BinaryAbstractOutputStream.capacity(536870912, 536870913));
  
          final int MAX_SIZE = BinaryAbstractOutputStream.MAX_ARRAY_SIZE;
  
          assertEquals(MAX_SIZE, BinaryAbstractOutputStream.capacity(1073741824, 1073741825));
  
          assertEquals(MAX_SIZE, BinaryAbstractOutputStream.capacity(0, 1073741825));
  
          assertEquals(MAX_SIZE, BinaryAbstractOutputStream.capacity(1073741824, 1500000000));
  
          assertEquals(MAX_SIZE, BinaryAbstractOutputStream.capacity(1073741824, 2000000000));
  
          assertEquals(MAX_SIZE, BinaryAbstractOutputStream.capacity(1073741824, Integer.MAX_VALUE - 9));
  
          assertEquals(MAX_SIZE, BinaryAbstractOutputStream.capacity(1073741824, Integer.MAX_VALUE - 8));
  
          try {
              assertEquals(MAX_SIZE, BinaryAbstractOutputStream.capacity(0, Integer.MAX_VALUE - 7));
  
              fail();
          }
          catch (IllegalArgumentException ignored) {
              // Expected exception.
          }
      }
test_case.class_method_signature: BinaryAbstractOutputStreamTest.testCapacity()
test_case.full_signature: @Test public void testCapacity()
test_case.identifier: testCapacity
test_case.invocations: assertEquals capacity assertEquals capacity assertEquals capacity assertEquals capacity assertEquals capacity assertEquals capacity assertEquals capacity assertEquals capacity assertEquals capacity assertEquals capacity assertEquals capacity assertEquals capacity assertEquals capacity assertEquals capacity assertEquals capacity assertEquals capacity assertEquals capacity assertEquals capacity assertEquals capacity assertEquals capacity assertEquals capacity assertEquals capacity assertEquals capacity assertEquals capacity assertEquals capacity assertEquals capacity assertEquals capacity assertEquals capacity assertEquals capacity assertEquals capacity assertEquals capacity assertEquals capacity assertEquals capacity fail
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCapacity()
focal_class.declarator: MIN_CAP = 256
focal_class.modifier: private static final
focal_class.original_string: private static final int MIN_CAP = 256;
focal_class.type: int
focal_class.var_name: MIN_CAP
focal_class.declarator: MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8
focal_class.modifier: protected static final
focal_class.original_string: protected static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8;
focal_class.type: int
focal_class.var_name: MAX_ARRAY_SIZE
focal_class.file: modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java
focal_class.identifier: BinaryAbstractOutputStream
focal_class.interfaces: implements BinaryOutputStream
focal_class.class_method_signature: BinaryAbstractOutputStream.writeByte(byte val)
focal_class.full_signature: @Override public void writeByte(byte val)
focal_class.identifier: writeByte
focal_class.modifiers: @Override public
focal_class.parameters: (byte val)
focal_class.return: void
focal_class.signature: void writeByte(byte val)
focal_class.class_method_signature: BinaryAbstractOutputStream.writeByteArray(byte[] val)
focal_class.full_signature: @Override public void writeByteArray(byte[] val)
focal_class.identifier: writeByteArray
focal_class.modifiers: @Override public
focal_class.parameters: (byte[] val)
focal_class.return: void
focal_class.signature: void writeByteArray(byte[] val)
focal_class.class_method_signature: BinaryAbstractOutputStream.writeBoolean(boolean val)
focal_class.full_signature: @Override public void writeBoolean(boolean val)
focal_class.identifier: writeBoolean
focal_class.modifiers: @Override public
focal_class.parameters: (boolean val)
focal_class.return: void
focal_class.signature: void writeBoolean(boolean val)
focal_class.class_method_signature: BinaryAbstractOutputStream.writeBooleanArray(boolean[] val)
focal_class.full_signature: @Override public void writeBooleanArray(boolean[] val)
focal_class.identifier: writeBooleanArray
focal_class.modifiers: @Override public
focal_class.parameters: (boolean[] val)
focal_class.return: void
focal_class.signature: void writeBooleanArray(boolean[] val)
focal_class.class_method_signature: BinaryAbstractOutputStream.writeShort(short val)
focal_class.full_signature: @Override public void writeShort(short val)
focal_class.identifier: writeShort
focal_class.modifiers: @Override public
focal_class.parameters: (short val)
focal_class.return: void
focal_class.signature: void writeShort(short val)
focal_class.class_method_signature: BinaryAbstractOutputStream.writeShortArray(short[] val)
focal_class.full_signature: @Override public void writeShortArray(short[] val)
focal_class.identifier: writeShortArray
focal_class.modifiers: @Override public
focal_class.parameters: (short[] val)
focal_class.return: void
focal_class.signature: void writeShortArray(short[] val)
focal_class.class_method_signature: BinaryAbstractOutputStream.writeChar(char val)
focal_class.full_signature: @Override public void writeChar(char val)
focal_class.identifier: writeChar
focal_class.modifiers: @Override public
focal_class.parameters: (char val)
focal_class.return: void
focal_class.signature: void writeChar(char val)
focal_class.class_method_signature: BinaryAbstractOutputStream.writeCharArray(char[] val)
focal_class.full_signature: @Override public void writeCharArray(char[] val)
focal_class.identifier: writeCharArray
focal_class.modifiers: @Override public
focal_class.parameters: (char[] val)
focal_class.return: void
focal_class.signature: void writeCharArray(char[] val)
focal_class.class_method_signature: BinaryAbstractOutputStream.writeInt(int val)
focal_class.full_signature: @Override public void writeInt(int val)
focal_class.identifier: writeInt
focal_class.modifiers: @Override public
focal_class.parameters: (int val)
focal_class.return: void
focal_class.signature: void writeInt(int val)
focal_class.class_method_signature: BinaryAbstractOutputStream.writeShort(int pos, short val)
focal_class.full_signature: @Override public void writeShort(int pos, short val)
focal_class.identifier: writeShort
focal_class.modifiers: @Override public
focal_class.parameters: (int pos, short val)
focal_class.return: void
focal_class.signature: void writeShort(int pos, short val)
focal_class.class_method_signature: BinaryAbstractOutputStream.writeInt(int pos, int val)
focal_class.full_signature: @Override public void writeInt(int pos, int val)
focal_class.identifier: writeInt
focal_class.modifiers: @Override public
focal_class.parameters: (int pos, int val)
focal_class.return: void
focal_class.signature: void writeInt(int pos, int val)
focal_class.class_method_signature: BinaryAbstractOutputStream.writeIntArray(int[] val)
focal_class.full_signature: @Override public void writeIntArray(int[] val)
focal_class.identifier: writeIntArray
focal_class.modifiers: @Override public
focal_class.parameters: (int[] val)
focal_class.return: void
focal_class.signature: void writeIntArray(int[] val)
focal_class.class_method_signature: BinaryAbstractOutputStream.writeFloat(float val)
focal_class.full_signature: @Override public void writeFloat(float val)
focal_class.identifier: writeFloat
focal_class.modifiers: @Override public
focal_class.parameters: (float val)
focal_class.return: void
focal_class.signature: void writeFloat(float val)
focal_class.class_method_signature: BinaryAbstractOutputStream.writeFloatArray(float[] val)
focal_class.full_signature: @Override public void writeFloatArray(float[] val)
focal_class.identifier: writeFloatArray
focal_class.modifiers: @Override public
focal_class.parameters: (float[] val)
focal_class.return: void
focal_class.signature: void writeFloatArray(float[] val)
focal_class.class_method_signature: BinaryAbstractOutputStream.writeLong(long val)
focal_class.full_signature: @Override public void writeLong(long val)
focal_class.identifier: writeLong
focal_class.modifiers: @Override public
focal_class.parameters: (long val)
focal_class.return: void
focal_class.signature: void writeLong(long val)
focal_class.class_method_signature: BinaryAbstractOutputStream.writeLongArray(long[] val)
focal_class.full_signature: @Override public void writeLongArray(long[] val)
focal_class.identifier: writeLongArray
focal_class.modifiers: @Override public
focal_class.parameters: (long[] val)
focal_class.return: void
focal_class.signature: void writeLongArray(long[] val)
focal_class.class_method_signature: BinaryAbstractOutputStream.writeDouble(double val)
focal_class.full_signature: @Override public void writeDouble(double val)
focal_class.identifier: writeDouble
focal_class.modifiers: @Override public
focal_class.parameters: (double val)
focal_class.return: void
focal_class.signature: void writeDouble(double val)
focal_class.class_method_signature: BinaryAbstractOutputStream.writeDoubleArray(double[] val)
focal_class.full_signature: @Override public void writeDoubleArray(double[] val)
focal_class.identifier: writeDoubleArray
focal_class.modifiers: @Override public
focal_class.parameters: (double[] val)
focal_class.return: void
focal_class.signature: void writeDoubleArray(double[] val)
focal_class.class_method_signature: BinaryAbstractOutputStream.write(byte[] arr, int off, int len)
focal_class.full_signature: @Override public void write(byte[] arr, int off, int len)
focal_class.identifier: write
focal_class.modifiers: @Override public
focal_class.parameters: (byte[] arr, int off, int len)
focal_class.return: void
focal_class.signature: void write(byte[] arr, int off, int len)
focal_class.class_method_signature: BinaryAbstractOutputStream.write(long addr, int cnt)
focal_class.full_signature: @Override public void write(long addr, int cnt)
focal_class.identifier: write
focal_class.modifiers: @Override public
focal_class.parameters: (long addr, int cnt)
focal_class.return: void
focal_class.signature: void write(long addr, int cnt)
focal_class.class_method_signature: BinaryAbstractOutputStream.position(int pos)
focal_class.full_signature: @Override public void position(int pos)
focal_class.identifier: position
focal_class.modifiers: @Override public
focal_class.parameters: (int pos)
focal_class.return: void
focal_class.signature: void position(int pos)
focal_class.class_method_signature: BinaryAbstractOutputStream.offheapPointer()
focal_class.full_signature: @Override public long offheapPointer()
focal_class.identifier: offheapPointer
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long offheapPointer()
focal_class.class_method_signature: BinaryAbstractOutputStream.rawOffheapPointer()
focal_class.full_signature: @Override public long rawOffheapPointer()
focal_class.identifier: rawOffheapPointer
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long rawOffheapPointer()
focal_class.class_method_signature: BinaryAbstractOutputStream.unsafeEnsure(int cap)
focal_class.full_signature: @Override public void unsafeEnsure(int cap)
focal_class.identifier: unsafeEnsure
focal_class.modifiers: @Override public
focal_class.parameters: (int cap)
focal_class.return: void
focal_class.signature: void unsafeEnsure(int cap)
focal_class.class_method_signature: BinaryAbstractOutputStream.unsafePosition(int pos)
focal_class.full_signature: @Override public void unsafePosition(int pos)
focal_class.identifier: unsafePosition
focal_class.modifiers: @Override public
focal_class.parameters: (int pos)
focal_class.return: void
focal_class.signature: void unsafePosition(int pos)
focal_class.class_method_signature: BinaryAbstractOutputStream.unsafeWriteBoolean(boolean val)
focal_class.full_signature: @Override public void unsafeWriteBoolean(boolean val)
focal_class.identifier: unsafeWriteBoolean
focal_class.modifiers: @Override public
focal_class.parameters: (boolean val)
focal_class.return: void
focal_class.signature: void unsafeWriteBoolean(boolean val)
focal_class.class_method_signature: BinaryAbstractOutputStream.unsafeWriteFloat(float val)
focal_class.full_signature: @Override public void unsafeWriteFloat(float val)
focal_class.identifier: unsafeWriteFloat
focal_class.modifiers: @Override public
focal_class.parameters: (float val)
focal_class.return: void
focal_class.signature: void unsafeWriteFloat(float val)
focal_class.class_method_signature: BinaryAbstractOutputStream.unsafeWriteDouble(double val)
focal_class.full_signature: @Override public void unsafeWriteDouble(double val)
focal_class.identifier: unsafeWriteDouble
focal_class.modifiers: @Override public
focal_class.parameters: (double val)
focal_class.return: void
focal_class.signature: void unsafeWriteDouble(double val)
focal_class.class_method_signature: BinaryAbstractOutputStream.capacity(int curCap, int reqCap)
focal_class.full_signature: protected static int capacity(int curCap, int reqCap)
focal_class.identifier: capacity
focal_class.modifiers: protected static
focal_class.parameters: (int curCap, int reqCap)
focal_class.return: int
focal_class.signature: int capacity(int curCap, int reqCap)
focal_class.class_method_signature: BinaryAbstractOutputStream.writeByteAndShift(byte val)
focal_class.full_signature: protected abstract void writeByteAndShift(byte val)
focal_class.identifier: writeByteAndShift
focal_class.modifiers: protected abstract
focal_class.parameters: (byte val)
focal_class.return: void
focal_class.signature: void writeByteAndShift(byte val)
focal_class.class_method_signature: BinaryAbstractOutputStream.copyAndShift(Object src, long off, int len)
focal_class.full_signature: protected abstract void copyAndShift(Object src, long off, int len)
focal_class.identifier: copyAndShift
focal_class.modifiers: protected abstract
focal_class.parameters: (Object src, long off, int len)
focal_class.return: void
focal_class.signature: void copyAndShift(Object src, long off, int len)
focal_class.class_method_signature: BinaryAbstractOutputStream.writeShortFast(short val)
focal_class.full_signature: protected abstract void writeShortFast(short val)
focal_class.identifier: writeShortFast
focal_class.modifiers: protected abstract
focal_class.parameters: (short val)
focal_class.return: void
focal_class.signature: void writeShortFast(short val)
focal_class.class_method_signature: BinaryAbstractOutputStream.writeCharFast(char val)
focal_class.full_signature: protected abstract void writeCharFast(char val)
focal_class.identifier: writeCharFast
focal_class.modifiers: protected abstract
focal_class.parameters: (char val)
focal_class.return: void
focal_class.signature: void writeCharFast(char val)
focal_class.class_method_signature: BinaryAbstractOutputStream.writeIntFast(int val)
focal_class.full_signature: protected abstract void writeIntFast(int val)
focal_class.identifier: writeIntFast
focal_class.modifiers: protected abstract
focal_class.parameters: (int val)
focal_class.return: void
focal_class.signature: void writeIntFast(int val)
focal_class.class_method_signature: BinaryAbstractOutputStream.writeLongFast(long val)
focal_class.full_signature: protected abstract void writeLongFast(long val)
focal_class.identifier: writeLongFast
focal_class.modifiers: protected abstract
focal_class.parameters: (long val)
focal_class.return: void
focal_class.signature: void writeLongFast(long val)
focal_class.class_method_signature: BinaryAbstractOutputStream.ensureCapacity(int cnt)
focal_class.full_signature: protected abstract void ensureCapacity(int cnt)
focal_class.identifier: ensureCapacity
focal_class.modifiers: protected abstract
focal_class.parameters: (int cnt)
focal_class.return: void
focal_class.signature: void ensureCapacity(int cnt)
focal_class.superclass: extends BinaryAbstractStream
focal_method.body: protected static int capacity(int curCap, int reqCap) {
          int newCap;
  
          if (reqCap < MIN_CAP)
              newCap = MIN_CAP;
          else if (reqCap > MAX_ARRAY_SIZE)
              throw new IllegalArgumentException("Required capacity exceeds allowed. Required:" + reqCap);
          else {
              newCap = Math.max(curCap, MIN_CAP);
  
              while (newCap < reqCap) {
                  newCap = newCap << 1;
  
                  if (newCap < 0)
                      newCap = MAX_ARRAY_SIZE;
              }
          }
  
          return newCap;
      }
focal_method.class_method_signature: BinaryAbstractOutputStream.capacity(int curCap, int reqCap)
focal_method.full_signature: protected static int capacity(int curCap, int reqCap)
focal_method.identifier: capacity
focal_method.invocations: max
focal_method.modifiers: protected static
focal_method.parameters: (int curCap, int reqCap)
focal_method.return: int
focal_method.signature: int capacity(int curCap, int reqCap)