|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdeadbeef.Tools.FileBuffer
public class FileBuffer
Very simple version of a read only memory mapped file used for parsing large packet based files.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Constructor Summary | |
---|---|
FileBuffer(java.lang.String fname)
Constructor. |
Method Summary | |
---|---|
void |
close()
Close file buffer (closes input file). |
void |
finalize()
|
int |
getByte(long ofs)
Read one byte from the buffer. |
void |
getBytes(long ofs,
byte[] b,
int len)
Read multiple bytes from the buffer. |
int |
getDWord(long ofs)
Read one (big endian) 32bit dword from the buffer. |
int |
getDWordLE(long ofs)
Read one (little endian) 32bit dword from the buffer. |
long |
getSize()
Get size of input file. |
int |
getWord(long ofs)
Read one (big endian) 16bit word from the buffer. |
int |
getWordLE(long ofs)
Read one (little endian) 16bit word from the buffer. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileBuffer(java.lang.String fname) throws FileBufferException
fname
- File name of input file
FileBufferException
Method Detail |
---|
public int getByte(long ofs) throws FileBufferException
ofs
- File offset
FileBufferException
public int getWord(long ofs) throws FileBufferException
ofs
- File offset
FileBufferException
public int getWordLE(long ofs) throws FileBufferException
ofs
- File offset
FileBufferException
public int getDWord(long ofs) throws FileBufferException
ofs
- File offset
FileBufferException
public int getDWordLE(long ofs) throws FileBufferException
ofs
- File offset
FileBufferException
public void getBytes(long ofs, byte[] b, int len) throws FileBufferException
ofs
- File offsetb
- Buffer to store bytes (has to be allocated and large enough)len
- Number of bytes to read
FileBufferException
public long getSize()
public void close()
public void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |