public class IospArrayHelper extends Object
| Constructor and Description |
|---|
IospArrayHelper() |
| Modifier and Type | Method and Description |
|---|---|
static char[] |
convertByteToChar(byte[] byteArray) |
static char[] |
convertByteToCharUTF(byte[] byteArray) |
static byte[] |
convertCharToByte(char[] from) |
static byte[] |
convertCharToByteUTF(char[] from) |
static Object |
makePrimitiveArray(int size,
ArrayType ArrayType)
Create 1D primitive array of the given size and type
|
static Object |
makePrimitiveArray(int size,
ArrayType ArrayType,
Object fillValue)
Create 1D primitive array of the given size and type, fill it with the given value
|
static Object |
readData(LayoutBB layout,
ArrayType ArrayType,
Object arr)
Read data subset from ByteBuffer, place in given primitive array.
|
static Object |
readData(PositioningDataInputStream raf,
Layout index,
ArrayType ArrayType,
Object arr)
Read data subset from PositioningDataInputStream, place in given primitive array.
|
static Object |
readData(RandomAccessFile raf,
Layout layout,
ArrayType ArrayType,
Object arr,
ByteOrder byteOrder,
boolean convertChar)
Read data subset from RandomAccessFile, place in given primitive array.
|
static Object |
readDataFill(LayoutBB layout,
ArrayType ArrayType,
Object fillValue)
Read data subset from ByteBuffer, create primitive array of size Layout.getTotalNelems.
|
static Object |
readDataFill(PositioningDataInputStream is,
Layout index,
ArrayType ArrayType,
Object fillValue)
Read data subset from PositioningDataInputStream, create primitive array of size Layout.getTotalNelems.
|
static Object |
readDataFill(RandomAccessFile raf,
Layout index,
ArrayType ArrayType,
Object fillValue,
ByteOrder byteOrder)
Read data subset from RandomAccessFile, create primitive array of size Layout.getTotalNelems.
|
static Object |
readDataFill(RandomAccessFile raf,
Layout index,
ArrayType ArrayType,
Object fillValue,
ByteOrder byteOrder,
boolean convertChar) |
public static Object readDataFill(RandomAccessFile raf, Layout index, ArrayType ArrayType, Object fillValue, ByteOrder byteOrder) throws IOException
raf - read from here.index - handles skipping around in the file.ArrayType - ArrayType of the variablefillValue - must be Number if ArrayType.isNumeric(), or String for STRING, byte[] for Structure, or null for
nonebyteOrder - if equal to RandomAccessFile.ORDER_XXXX, set the byte order just before readingIOException - on read errorpublic static Object readDataFill(RandomAccessFile raf, Layout index, ArrayType ArrayType, Object fillValue, ByteOrder byteOrder, boolean convertChar) throws IOException
IOExceptionpublic static Object readData(RandomAccessFile raf, Layout layout, ArrayType ArrayType, Object arr, ByteOrder byteOrder, boolean convertChar) throws IOException
raf - read from here.layout - handles skipping around in the file.ArrayType - ArrayType of the variablearr - primitive array to read data intobyteOrder - if equal to RandomAccessFile.ORDER_XXXX, set the byte order just before readingconvertChar - true if bytes should be converted to char for ArrayType CHARIOException - on read errorpublic static Object readDataFill(PositioningDataInputStream is, Layout index, ArrayType ArrayType, Object fillValue) throws IOException
is - read from here.index - handles skipping around in the file.ArrayType - ArrayType of the variablefillValue - must be Number if ArrayType.isNumeric(), or String for STRING, byte[] for Structure, or null for
noneIOException - on read errorpublic static Object readData(PositioningDataInputStream raf, Layout index, ArrayType ArrayType, Object arr) throws IOException
raf - read from here.index - handles skipping around in the file.ArrayType - ArrayType of the variablearr - primitive array to read data intoIOException - on read errorpublic static Object readDataFill(LayoutBB layout, ArrayType ArrayType, Object fillValue)
layout - handles skipping around in the file, provide ByteBuffer to read fromArrayType - ArrayType of the variablefillValue - must be Number if ArrayType.isNumeric(), or String for STRING, byte[] for Structure, or null for
nonepublic static Object readData(LayoutBB layout, ArrayType ArrayType, Object arr)
layout - handles skipping around in the file, privide ByteBuffer to read fromArrayType - ArrayType of the variablearr - primitive array to read data intopublic static Object makePrimitiveArray(int size, ArrayType ArrayType)
size - the size of the array to createArrayType - ArrayType of the variablepublic static Object makePrimitiveArray(int size, ArrayType ArrayType, Object fillValue)
size - the size of the array to createArrayType - ArrayType of the variablefillValue - must be Number if ArrayType.isNumeric(), or String for STRING, byte[] for Structure, or null for
nonepublic static char[] convertByteToCharUTF(byte[] byteArray)
public static byte[] convertCharToByteUTF(char[] from)
public static char[] convertByteToChar(byte[] byteArray)
public static byte[] convertCharToByte(char[] from)