public abstract class BinaryTransform extends BaseTransform
CS_UTF8, CS_WIN1252, type, UTF8, WIN1252mojo| Constructor and Description |
|---|
BinaryTransform(BaseMojo mojo,
String type) |
| Modifier and Type | Method and Description |
|---|---|
protected String |
getString(byte[] data)
Returns a string value from a zero-terminated byte array.
|
protected String |
getString(byte[] data,
int offset)
Returns a string value from a zero-terminated byte array at the specified offset.
|
protected String |
getString(byte[] data,
int offset,
int length)
Returns a string value from the byte array.
|
protected byte[] |
loadBinaryFile(String file)
Loads the entire contents of a binary file into a byte array.
|
protected int |
readDWord(byte[] data,
int offset)
Reads a four-byte integer from a byte array at the specified offset.
|
protected int |
readDWord(InputStream inputStream)
Reads a four-byte integer from the input stream.
|
protected int |
readWord(byte[] data,
int offset)
Reads a two-byte integer from a byte array at the specified offset.
|
protected int |
readWord(InputStream inputStream)
Reads a two-byte integer from the input stream.
|
void |
transform(IResource resource,
OutputStream outputStream) |
extractAttribute, getTargetPath, write, write, writeAttribute, writeSettingtransformpublic void transform(IResource resource, OutputStream outputStream) throws Exception
transform in class BaseTransformExceptionprotected int readDWord(InputStream inputStream) throws IOException
inputStream - The input stream.IOExceptionprotected int readWord(InputStream inputStream) throws IOException
inputStream - The input stream.IOException - Exception while reading from input stream.protected int readDWord(byte[] data,
int offset)
data - The source data.offset - The byte offset.protected int readWord(byte[] data,
int offset)
data - The source data.offset - The byte offset.protected String getString(byte[] data)
data - The source data.protected String getString(byte[] data, int offset)
data - The source data.offset - The byte offset.protected String getString(byte[] data, int offset, int length)
data - The source data.offset - The byte offset.length - The string length.protected byte[] loadBinaryFile(String file) throws IOException
file - The path to the binary file.IOException - Exception while reading from file.Copyright © 2016 Regenstrief Center for Biomedical Informatics. All rights reserved.