public AVHeader(BaseBlock bb, byte[] avHeader){ super(bb); int pos =0; unpackVersion |= avHeader[pos]&0xff; pos++; method |= avHeader[pos]&0xff; pos++; avVersion |= avHeader[pos]&0xff; pos++; avInfoCRC = Raw.readIntLittleEndian(avHeader, pos); }
public ProtectHeader(BlockHeader bh, byte[] protectHeader){ super(bh); int pos = 0; version |= protectHeader[pos]&0xff; recSectors = Raw.readShortLittleEndian(protectHeader, pos); pos += 2; totalBlocks = Raw.readIntLittleEndian(protectHeader, pos); pos += 4; mark |= protectHeader[pos]&0xff; }
public void setNU(int nu) { NU = nu&0xffff; if (mem != null) { Raw.writeShortLittleEndian(mem, pos + 2, (short)nu); } }
public void setNext(int next) { this.next = next; if (mem != null) { Raw.writeIntLittleEndian(mem, pos + 4, next); } }
public BaseBlock(byte[] baseBlockHeader){ int pos = 0; this.headCRC = Raw.readShortLittleEndian(baseBlockHeader, pos); pos+=2; this.headerType |= baseBlockHeader[pos]&0xff; pos++; this.flags = Raw.readShortLittleEndian(baseBlockHeader, pos); pos+=2; this.headerSize = Raw.readShortLittleEndian(baseBlockHeader, pos); }
public int readFully(byte[] buffer, int count) throws IOException { assert (count > 0) : count; this.readFully(buffer, 0, count); return count; }
@Override public int read(byte[] b) throws IOException { return read(b, 0, b.length); } //
public int getSuffix() { if(mem!=null){ suffix = Raw.readIntLittleEndian(mem, pos+8); } return suffix; }
public void setLowEndianValue(byte[] mem, int offset, int value) { Raw.writeIntLittleEndian(mem, offset, value); // mem[offset + 0] = (byte) (value&0xff); // mem[offset + 1] = (byte) ((value >>> 8)&0xff); // mem[offset + 2] = (byte) ((value >>> 16)&0xff); // mem[offset + 3] = (byte) ((value >>> 24)&0xff); } public void setLowEndianValue(Vector<Byte> mem, int offset, int value) {
public CommentHeader(BaseBlock bb, byte[] commentHeader){ super(bb); int pos =0; unpSize = Raw.readShortLittleEndian(commentHeader, pos); pos += 2; unpVersion |= commentHeader[pos]&0xff; pos++; unpMethod |= commentHeader[pos]&0xff; pos++; commCRC =Raw.readShortLittleEndian(commentHeader, pos); }
public final void setNumStats(int numStats) { this.numStats = numStats&0xffff; if (mem != null) { Raw.writeShortLittleEndian(mem, pos, (short)numStats); } }
public int getPrev() { if(mem!=null){ prev = Raw.readIntLittleEndian(mem, pos+8); } return prev; }
public void setSuffix(int suffix) { this.suffix = suffix; if (mem != null) { Raw.writeIntLittleEndian(mem, pos + 8, suffix); } }
public SubBlockHeader(BlockHeader bh, byte[] subblock) { super(bh); int position = 0; subType = Raw.readShortLittleEndian(subblock, position); position +=2; level |= subblock[position]&0xff; }
public MacInfoHeader(SubBlockHeader sb, byte[] macHeader) { super(sb); int pos = 0; fileType = Raw.readIntLittleEndian(macHeader, pos); pos+=4; fileCreator = Raw.readIntLittleEndian(macHeader, pos); }
public void setPrev(int prev) { this.prev = prev; if (mem != null) { Raw.writeIntLittleEndian(mem, pos + 8, prev); } }
public int getNext() { if(mem!=null){ next = Raw.readIntLittleEndian(mem, pos); } return next; }
public BlockHeader(BaseBlock bb, byte[] blockHeader) { super(bb); this.packSize = Raw.readIntLittleEndian(blockHeader, 0); this.dataSize = this.packSize; }
public EAHeader(SubBlockHeader sb, byte[] eahead) { super(sb); int pos = 0; unpSize = Raw.readIntLittleEndian(eahead, pos); pos+=4; unpVer |= eahead[pos]&0xff; pos++; method |= eahead[pos]&0xff; pos++; EACRC = Raw.readIntLittleEndian(eahead, pos); }
public int getNext() { if(mem!=null){ next = Raw.readIntLittleEndian(mem, pos+4); } return next; }