public final class VaxEncoding
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static int |
decodeVaxInteger2WithoutLength(java.io.InputStream in)
Decodes an integer using two byte Vax encoding from an input stream, without length prefix.
|
static void |
encodeVaxInteger(byte[] buf,
int off,
int val)
Encodes an integer using Vax encoding into
buf, length prefix is included. |
static void |
encodeVaxInteger(java.io.OutputStream out,
int val)
Encodes an integer using Vax encoding into an output stream, length prefix is included.
|
static void |
encodeVaxInteger2WithoutLength(byte[] buf,
int off,
int val)
Encodes an integer using two byte Vax encoding into
buf, without length prefix. |
static void |
encodeVaxInteger2WithoutLength(java.io.OutputStream out,
int val)
Encodes an integer using two byte Vax encoding into an output stream, without length prefix.
|
static void |
encodeVaxIntegerWithoutLength(byte[] buf,
int off,
int val)
Encodes an integer using Vax encoding into
buf, without length prefix. |
static void |
encodeVaxIntegerWithoutLength(java.io.OutputStream out,
int val)
Encodes an integer using Vax encoding into an output stream, without length prefix.
|
static void |
encodeVaxLong(byte[] buf,
int off,
long val)
Encodes a long using Vax encoding into
buf, length prefix is included. |
static void |
encodeVaxLong(java.io.OutputStream out,
long val)
Encodes a long using Vax encoding into an output stream, length prefix is included.
|
static void |
encodeVaxLongWithoutLength(byte[] buf,
int off,
long val)
Encodes a long using Vax encoding into
buf, without length prefix. |
static void |
encodeVaxLongWithoutLength(java.io.OutputStream out,
long val)
Encodes a long using Vax encoding into an output stream, without length prefix.
|
static int |
iscVaxInteger(byte[] buf,
int off,
int len)
Reads Vax style integers from
buf, starting at off and reading for len bytes. |
static int |
iscVaxInteger2(byte[] buf,
int off)
Variant of
iscVaxInteger(byte[], int, int) specifically for two-byte integers. |
static long |
iscVaxLong(byte[] buf,
int off,
int len)
Reads Vax style integers (longs) from
buf, starting at off and reading for len bytes. |
public static int iscVaxInteger(byte[] buf,
int off,
int len)
buf, starting at off and reading for len bytes.
This method is useful for lengths up to 4 bytes (i.e. normal Java integers (int). For larger lengths it
will return 0. Use iscVaxLong(byte[], int, int) for reading values with length up to 8 bytes.
For decoding 2 byte integers, use iscVaxInteger2(byte[], int) for optimal performance.
buf - byte array from which the integer is to be retrievedoff - offset from which to start retrieving byte valueslen - number of bytes to readiscVaxLong(byte[], int, int),
iscVaxInteger2(byte[], int)public static void encodeVaxInteger(java.io.OutputStream out,
int val)
throws java.io.IOException
out - output stream to writeval - value to encodejava.io.IOExceptionpublic static void encodeVaxInteger(byte[] buf,
int off,
int val)
buf, length prefix is included.buf - byte array of sufficient sizeoff - offset to start writingval - value to encodepublic static void encodeVaxIntegerWithoutLength(java.io.OutputStream out,
int val)
throws java.io.IOException
out - output stream to writeval - value to encodejava.io.IOExceptionpublic static void encodeVaxIntegerWithoutLength(byte[] buf,
int off,
int val)
buf, without length prefix.buf - byte array of sufficient sizeoff - offset to start writingval - value to encodepublic static long iscVaxLong(byte[] buf,
int off,
int len)
buf, starting at off and reading for len bytes.
This method is useful for lengths up to 8 bytes (i.e. normal Java longs (long). For larger lengths it
will return 0.
buf - byte array from which the long is to be retrievedoff - offset from which to start retrieving byte valueslen - number of bytes to readiscVaxInteger(byte[], int, int),
iscVaxInteger2(byte[], int)public static void encodeVaxLong(java.io.OutputStream out,
long val)
throws java.io.IOException
out - output stream to writeval - value to encodejava.io.IOExceptionpublic static void encodeVaxLong(byte[] buf,
int off,
long val)
buf, length prefix is included.buf - byte array of sufficient sizeoff - offset to start writingval - value to encodepublic static void encodeVaxLongWithoutLength(java.io.OutputStream out,
long val)
throws java.io.IOException
out - output stream to writeval - value to encodejava.io.IOExceptionpublic static void encodeVaxLongWithoutLength(byte[] buf,
int off,
long val)
buf, without length prefix.buf - byte array of sufficient sizeoff - offset to start writingval - value to encodepublic static int iscVaxInteger2(byte[] buf,
int off)
iscVaxInteger(byte[], int, int) specifically for two-byte integers.buf - byte array from which the integer is to be retrievedoff - offset from which to start retrieving byte valuesiscVaxInteger(byte[], int, int),
iscVaxLong(byte[], int, int)public static void encodeVaxInteger2WithoutLength(java.io.OutputStream out,
int val)
throws java.io.IOException
out - output stream to writeval - value to encodejava.io.IOExceptionpublic static void encodeVaxInteger2WithoutLength(byte[] buf,
int off,
int val)
buf, without length prefix.buf - byte array of sufficient sizeoff - offset to start writingval - value to encodepublic static int decodeVaxInteger2WithoutLength(java.io.InputStream in)
throws java.io.IOException
in - input stream to readjava.io.IOException - for errors reading from the stream, or if end-of-stream was reached before the full integerCopyright © 2001-2025 Jaybird (Firebird JDBC) team. All rights reserved.