public class IonStreamUtils extends Object
Constructor and Description |
---|
IonStreamUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
isGzip(byte[] buffer,
int offset,
int length)
Determines whether a buffer contains GZIPped data.
|
static boolean |
isIonBinary(byte[] buffer)
Determines whether a buffer contains Ion binary data by looking for the
presence of the Ion Version Marker at its start.
|
static boolean |
isIonBinary(byte[] buffer,
int offset,
int length)
Determines whether a buffer contains Ion binary data by looking for the
presence of the Ion Version Marker at a given offset.
|
static InputStream |
unGzip(InputStream in)
Returns a stream that decompresses a stream if it contains GZIPped data,
otherwise has no effect on the stream (but may wrap it).
|
static void |
writeBoolList(IonWriter writer,
boolean[] values)
writes an IonList with a series of IonBool values.
|
static void |
writeFloatList(IonWriter writer,
double[] values)
writes an IonList with a series of IonFloat values.
|
static void |
writeFloatList(IonWriter writer,
float[] values)
writes an IonList with a series of IonFloat values.
|
static void |
writeIntList(IonWriter writer,
byte[] values)
writes an IonList with a series of IonInt values.
|
static void |
writeIntList(IonWriter writer,
int[] values)
writes an IonList with a series of IonInt values.
|
static void |
writeIntList(IonWriter writer,
long[] values)
writes an IonList with a series of IonInt values.
|
static void |
writeIntList(IonWriter writer,
short[] values)
writes an IonList with a series of IonInt values.
|
static void |
writeStringList(IonWriter writer,
String[] values)
writes an IonList with a series of IonString values.
|
public static boolean isIonBinary(byte[] buffer)
false
result does not imply that the buffer has Ion text,
just that it's not Ion binary.buffer
- the data to check.true
if the buffer contains Ion binary (starting from
offset zero); false
if the buffer is null or too short.isIonBinary(byte[], int, int)
public static boolean isIonBinary(byte[] buffer, int offset, int length)
false
result does not imply that the buffer has Ion text,
just that it's not Ion binary.buffer
- the data to check.offset
- the position in the buffer at which to start reading.length
- the number of bytes in the buffer that are valid,
starting from offset
.true
if the buffer contains Ion binary (starting from
offset
); false
if the buffer is null or if the
length
is too short.isIonBinary(byte[])
public static boolean isGzip(byte[] buffer, int offset, int length)
buffer
- the data to check.offset
- the position in the buffer at which to start reading.length
- the number of bytes in the buffer that are valid,
starting from offset
.true
if the buffer contains GZIPped data; false
if the buffer is null or if the length
is too short.public static InputStream unGzip(InputStream in) throws IOException
IOException
public static void writeBoolList(IonWriter writer, boolean[] values) throws IOException
values
- boolean values to populate the list withIOException
public static void writeFloatList(IonWriter writer, float[] values) throws IOException
values
- 32 bit float values to populate the lists IonFloat's withIOException
public static void writeFloatList(IonWriter writer, double[] values) throws IOException
values
- 64 bit float values to populate the lists IonFloat's withIOException
public static void writeIntList(IonWriter writer, byte[] values) throws IOException
values
- signed byte values to populate the lists int's withIOException
public static void writeIntList(IonWriter writer, short[] values) throws IOException
values
- signed short values to populate the lists int's withIOException
public static void writeIntList(IonWriter writer, int[] values) throws IOException
values
- signed int values to populate the lists int's withIOException
public static void writeIntList(IonWriter writer, long[] values) throws IOException
values
- signed long values to populate the lists int's withIOException
public static void writeStringList(IonWriter writer, String[] values) throws IOException
values
- Java String to populate the lists IonString's fromIOException