public abstract class CompressedNumber
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
MAX_COMPRESSED_INT_ONE_BYTE |
static int |
MAX_COMPRESSED_INT_TWO_BYTES |
static int |
MAX_INT_STORED_SIZE |
static int |
MAX_LONG_STORED_SIZE |
Constructor and Description |
---|
CompressedNumber() |
Modifier and Type | Method and Description |
---|---|
static int |
readInt(byte[] data,
int offset) |
static int |
readInt(java.io.DataInput in)
Read an integer previously written by writeInt().
|
static int |
readInt(java.io.InputStream in)
Read an integer previously written by writeInt().
|
static long |
readLong(byte[] data,
int offset) |
static long |
readLong(java.io.DataInput in)
Read a long previously written by writeLong().
|
static long |
readLong(java.io.InputStream in)
Read a long previously written by writeLong().
|
static int |
sizeInt(int value)
Return the number of bytes that would be written by a writeInt call
|
static int |
sizeLong(long value) |
static int |
writeInt(java.io.DataOutput out,
int value)
Write a compressed integer only supporting signed values.
|
static int |
writeInt(java.io.OutputStream out,
int value)
Write a compressed integer directly to an OutputStream.
|
static int |
writeLong(java.io.DataOutput out,
long value)
Write a compressed long only supporting signed values.
|
static int |
writeLong(java.io.OutputStream out,
long value)
Write a compressed integer only supporting signed values.
|
public static final int MAX_INT_STORED_SIZE
public static final int MAX_LONG_STORED_SIZE
public static final int MAX_COMPRESSED_INT_ONE_BYTE
public static final int MAX_COMPRESSED_INT_TWO_BYTES
public static final int writeInt(java.io.DataOutput out, int value) throws java.io.IOException
1 Byte - 00xxxxxx Represents the value <= 63 (0x3f) 2 Byte - 01xxxxxx xxxxxxxx Represents the value > 63 && <= 16383 (0x3fff) 4 byte - 1xxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx Represents the value > 16383 && <= MAX_INT
java.io.IOException
- value is negative or an exception was thrown by a method on out.public static final int writeInt(java.io.OutputStream out, int value) throws java.io.IOException
java.io.IOException
- an exception was thrown by a method on in.public static final int readInt(java.io.DataInput in) throws java.io.IOException
java.io.IOException
- an exception was thrown by a method on in.public static final int readInt(java.io.InputStream in) throws java.io.IOException
java.io.IOException
- an exception was thrown by a method on in.public static final int readInt(byte[] data, int offset)
public static final int sizeInt(int value)
public static final int writeLong(java.io.DataOutput out, long value) throws java.io.IOException
2 byte - 00xxxxxx xxxxxxxx Represents the value <= 16383 (0x3fff) 4 byte - 01xxxxxx xxxxxxxx xxxxxxxx xxxxxxxx Represents the value > 16383 && <= 0x3fffffff 8 byte - 1xxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx Represents the value > 0x3fffffff && <= MAX_LONG
java.io.IOException
- value is negative or an exception was thrown by a method on out.public static final int writeLong(java.io.OutputStream out, long value) throws java.io.IOException
java.io.IOException
- value is negative or an exception was thrown by a method on out.public static final long readLong(java.io.DataInput in) throws java.io.IOException
java.io.IOException
- an exception was thrown by a method on in.public static final long readLong(java.io.InputStream in) throws java.io.IOException
java.io.IOException
- an exception was thrown by a method on in.public static final long readLong(byte[] data, int offset)
public static final int sizeLong(long value)
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.