/** * Writes a short to the indicated position */ public void writeShort(int pos, short value) { data[pos+0] = (byte)(0xff & (value >> 8)); data[pos+1] = (byte)(0xff & (value >> 0)); setDirty(); }
/** * Writes an int to the indicated position */ public void writeInt( int pos, int value ) { data[pos + 0] = ( byte ) ( 0xff & ( value >> 24 ) ); data[pos + 1] = ( byte ) ( 0xff & ( value >> 16 ) ); data[pos + 2] = ( byte ) ( 0xff & ( value >> 8 ) ); data[pos + 3] = ( byte ) ( 0xff & ( value >> 0 ) ); setDirty(); }
/** * Writes a short to the indicated position */ public void writeShort( int pos, short value ) { data[pos+0] = ( byte ) ( 0xff & ( value >> 8 ) ); data[pos+1] = ( byte ) ( 0xff & ( value >> 0 ) ); setDirty(); }
/** * Writes an int to the indicated position */ public void writeInt( int pos, int value ) { data[pos+0] = ( byte ) ( 0xff & ( value >> 24 ) ); data[pos+1] = ( byte ) ( 0xff & ( value >> 16 ) ); data[pos+2] = ( byte ) ( 0xff & ( value >> 8 ) ); data[pos+3] = ( byte ) ( 0xff & ( value >> 0 ) ); setDirty(); }
/** * Writes a byte to the indicated position */ public void writeByte( int pos, byte value ) { data[pos] = value; setDirty(); }
/** * Writes a long to the indicated position */ public void writeLong(int pos, long value) { data[pos+0] = (byte)(0xff & (value >> 56)); data[pos+1] = (byte)(0xff & (value >> 48)); data[pos+2] = (byte)(0xff & (value >> 40)); data[pos+3] = (byte)(0xff & (value >> 32)); data[pos+4] = (byte)(0xff & (value >> 24)); data[pos+5] = (byte)(0xff & (value >> 16)); data[pos+6] = (byte)(0xff & (value >> 8)); data[pos+7] = (byte)(0xff & (value >> 0)); setDirty(); }
/** * Writes a short to the indicated position */ public void writeShort( int pos, short value ) { data[pos + 0] = ( byte ) ( 0xff & ( value >> 8 ) ); data[pos + 1] = ( byte ) ( 0xff & ( value >> 0 ) ); setDirty(); }
/** * Writes a byte to the indicated position */ public void writeByte( int pos, byte value ) { data[pos] = value; setDirty(); }
/** * Writes a byte to the indicated position */ public void writeByte(int pos, byte value) { data[pos] = value; setDirty(); }
/** * Writes an int to the indicated position */ public void writeInt(int pos, int value) { data[pos+0] = (byte)(0xff & (value >> 24)); data[pos+1] = (byte)(0xff & (value >> 16)); data[pos+2] = (byte)(0xff & (value >> 8)); data[pos+3] = (byte)(0xff & (value >> 0)); setDirty(); }
/** * Writes a long to the indicated position */ public void writeLong(int pos, long value) { data[pos+0] = (byte)(0xff & (value >> 56)); data[pos+1] = (byte)(0xff & (value >> 48)); data[pos+2] = (byte)(0xff & (value >> 40)); data[pos+3] = (byte)(0xff & (value >> 32)); data[pos+4] = (byte)(0xff & (value >> 24)); data[pos+5] = (byte)(0xff & (value >> 16)); data[pos+6] = (byte)(0xff & (value >> 8)); data[pos+7] = (byte)(0xff & (value >> 0)); setDirty(); }
/** * Writes a long to the indicated position */ public void writeSixByteLong(int pos, long value) { // if(value >> (6*8)!=0) // throw new IllegalArgumentException("does not fit"); data[pos+0] = (byte)(0xff & (value >> 40)); data[pos+1] = (byte)(0xff & (value >> 32)); data[pos+2] = (byte)(0xff & (value >> 24)); data[pos+3] = (byte)(0xff & (value >> 16)); data[pos+4] = (byte)(0xff & (value >> 8 )); data[pos+5] = (byte)(0xff & (value >> 0 )); setDirty(); }
/** * Writes a long to the indicated position */ public void writeLong( int pos, long value ) { data[pos + 0] = ( byte ) ( 0xff & ( value >> 56 ) ); data[pos + 1] = ( byte ) ( 0xff & ( value >> 48 ) ); data[pos + 2] = ( byte ) ( 0xff & ( value >> 40 ) ); data[pos + 3] = ( byte ) ( 0xff & ( value >> 32 ) ); data[pos + 4] = ( byte ) ( 0xff & ( value >> 24 ) ); data[pos + 5] = ( byte ) ( 0xff & ( value >> 16 ) ); data[pos + 6] = ( byte ) ( 0xff & ( value >> 8 ) ); data[pos + 7] = ( byte ) ( 0xff & ( value >> 0 ) ); setDirty(); }
/** * Writes an int to the indicated position */ public void writeThreeByteInt(int pos, int value) { if(value<0 || value>ThreeByteInt_MAX) throw new IllegalArgumentException("out of range: "+value); data[pos+0] = (byte)(0xff & (value >> 16)); data[pos+1] = (byte)(0xff & (value >> 8)); data[pos+2] = (byte)(0xff & (value >> 0)); setDirty(); }
public void writeUnsignedShort(int pos, int value) { if(value>UNSIGNED_SHORT_MAX || value<0) throw new IllegalArgumentException("Out of range: "+value); data[pos+0] = (byte)(0xff & (value >> 8)); data[pos+1] = (byte)(0xff & (value >> 0)); setDirty(); }
/** * Releases a block. * * @param blockId The record number to release. * @param isDirty If true, the block was modified since the get(). */ void release( long blockId, boolean isDirty ) throws IOException { BlockIo blockIo = inUse.get( blockId ); if ( blockIo == null ) { throw new IOException( I18n.err( I18n.ERR_555, blockId ) ); } if ( ! blockIo.isDirty() && isDirty ) { blockIo.setDirty(); } release( blockIo ); }
/** * Releases a block. * * @param blockid The record number to release. * @param isDirty If true, the block was modified since the get(). */ void release( long blockid, boolean isDirty ) throws IOException { BlockIo node = inUse.get( blockid ); if ( node == null ) { throw new IOException( I18n.err( I18n.ERR_555, blockid ) ); } if ( !node.isDirty() && isDirty ) { node.setDirty(); } release( node ); }
/** * Releases a block. * * @param blockid The record number to release. * @param isDirty If true, the block was modified since the get(). */ void release( long blockid, boolean isDirty ) throws IOException { BlockIo node = inUse.get( blockid ); if ( node == null ) { throw new IOException( I18n.err( I18n.ERR_555, blockid ) ); } if ( ! node.isDirty() && isDirty ) { node.setDirty(); } release( node ); }
/** * Releases a block. * * @param blockid The record number to release. * @param isDirty If true, the block was modified since the get(). */ void release(long blockid, boolean isDirty) throws IOException { BlockIo node = inUse.get(blockid); if (node == null) throw new IOException("bad blockid " + blockid + " on release"); if (!node.isDirty() && isDirty) node.setDirty(); release(node); }