# Class BinaryDocument

java.lang.Object
javajs.util.BC
javajs.util.BinaryDocument

All Implemented Interfaces:
  `GenericBinaryDocument, GenericBinaryDocumentReader`

Direct Known Subclasses:
  `CompoundDocument`

public class BinaryDocument extends BC implements GenericBinaryDocument

## Field Summary

Fields
Modifier and Type
Field
Description
`protected BufferedInputStream`
`bis`
`protected boolean`
`isBigEndian`
`protected boolean`
`isRandom`
`protected long`
`nBytes`
`protected GenericOutputChannel`
`out`
`protected DataInputStream`
`stream`

## Constructor Summary

Constructors
Constructor
Description
`BinaryDocument()`

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
`SB`
`getAllDataFiles(String binaryFileList, String firstFile)`
`void`
`getAllDataMapped(String replace, String string, Map<String,String> fileData)`
`BufferedInputStream`
`getInputStream()`
`long`
`getPosition()`
`byte`
`readByte()`
`int`
`readByteArray(byte[] b, int off, int len)`
`byte[]`
`readBytes(int n)`
`double`
`readDouble()`
`float`
`readFloat()`
`int`
`readInt()`
`int`
`readIntLE()`
`long`
`readLong()`
`short`
`readShort()`
`String`
`readString(int nChar)`
`int`
`readUInt8()`
`int`
`readUnsignedShort()`
`void`
`seek(long offset)`
`void`
`setBigEndian(boolean b)`
`void`
`setOutputChannel(GenericOutputChannel out)`
`void`
`setRandom(boolean TF)`
`BinaryDocument`
`setStream(BufferedInputStream bis, boolean isBigEndian)`
`void`
`setStreamData(DataInputStream stream, boolean isBigEndian)`
`int`
`swapBytesI(int n)`
`short`
`swapBytesS(short n)`

### Methods inherited from class BC

`bytesToDoubleToFloat, bytesToFloat, bytesToInt, bytesToShort, intToFloat, intToSignedInt`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### stream

protected DataInputStream stream

### isRandom

protected boolean isRandom

### isBigEndian

protected boolean isBigEndian

### bis

protected BufferedInputStream bis

### nBytes

protected long nBytes

### out

protected GenericOutputChannel out

## Constructor Details

### BinaryDocument

public BinaryDocument()

## Method Details

### close

public void close()

Specified by:
  `close` in interface `GenericBinaryDocument`

### setStream

public BinaryDocument setStream(BufferedInputStream bis, boolean isBigEndian)

Specified by:
  `setStream` in interface `GenericBinaryDocument`

### getInputStream

public BufferedInputStream getInputStream()

Specified by:
  `getInputStream` in interface `GenericBinaryDocument`

### setStreamData

public void setStreamData(DataInputStream stream, boolean isBigEndian)

Specified by:
  `setStreamData` in interface `GenericBinaryDocument`

### setOutputChannel

public void setOutputChannel(GenericOutputChannel out)

Specified by:
  `setOutputChannel` in interface `GenericBinaryDocument`

### setRandom

public void setRandom(boolean TF)

### readByte

public byte readByte() throws IOException

Specified by:
  `readByte` in interface `GenericBinaryDocumentReader`
Throws:
  `IOException`

### readUInt8

public int readUInt8() throws IOException

Specified by:
  `readUInt8` in interface `GenericBinaryDocumentReader`
Throws:
  `IOException`

### readBytes

public byte[] readBytes(int n) throws IOException

Specified by:
  `readBytes` in interface `GenericBinaryDocumentReader`
Throws:
  `IOException`

### readByteArray

public int readByteArray(byte[] b, int off, int len) throws IOException

Specified by:
  `readByteArray` in interface `GenericBinaryDocument`
Throws:
  `IOException`

### readString

public String readString(int nChar) throws IOException

Specified by:
  `readString` in interface `GenericBinaryDocumentReader`
Throws:
  `IOException`

### readShort

public short readShort() throws IOException

Specified by:
  `readShort` in interface `GenericBinaryDocumentReader`
Throws:
  `IOException`

### readIntLE

public int readIntLE() throws IOException

Specified by:
  `readIntLE` in interface `GenericBinaryDocument`
Throws:
  `IOException`

### readInt

public int readInt() throws IOException

Specified by:
  `readInt` in interface `GenericBinaryDocumentReader`
Throws:
  `IOException`

### swapBytesI

public int swapBytesI(int n)

Specified by:
  `swapBytesI` in interface `GenericBinaryDocument`

### swapBytesS

public short swapBytesS(short n)

Specified by:
  `swapBytesS` in interface `GenericBinaryDocument`

### readUnsignedShort

public int readUnsignedShort() throws IOException

Specified by:
  `readUnsignedShort` in interface `GenericBinaryDocumentReader`
Throws:
  `IOException`

### readLong

public long readLong() throws IOException

Specified by:
  `readLong` in interface `GenericBinaryDocumentReader`
Throws:
  `IOException`

### readFloat

public float readFloat() throws Exception

Specified by:
  `readFloat` in interface `GenericBinaryDocumentReader`
Throws:
  `Exception`

### readDouble

public double readDouble() throws IOException

Specified by:
  `readDouble` in interface `GenericBinaryDocumentReader`
Throws:
  `IOException`

### seek

public void seek(long offset)

Specified by:
  `seek` in interface `GenericBinaryDocumentReader`

### getPosition

public long getPosition()

Specified by:
  `getPosition` in interface `GenericBinaryDocumentReader`

### getAllDataFiles

public SB getAllDataFiles(String binaryFileList, String firstFile)

Specified by:
  `getAllDataFiles` in interface `GenericBinaryDocument`

### getAllDataMapped

public void getAllDataMapped(String replace, String string, Map<String,String> fileData)

Specified by:
  `getAllDataMapped` in interface `GenericBinaryDocument`

### setBigEndian

public void setBigEndian(boolean b)

Specified by:
  `setBigEndian` in interface `GenericBinaryDocumentReader`