@Test public void testSetLong() throws Exception { block.setBigEndian(true); DataConverter conv = new BigEndianDataConverter(); byte[] b = new byte[8]; System.arraycopy(buf, 35, b, 0, b.length); conv.getLong(b); byte[] newb = new byte[8]; conv.putLong(newb, 0, 12425); block.setLong(BigInteger.valueOf(35), 12425); blockSet.notifyByteEditing(block, BigInteger.valueOf(35), b, newb); for (int i = 0; i < 8; i++) { assertTrue(blockSet.isChanged(block, BigInteger.valueOf(35 + i), b.length)); } block.setBigEndian(false); conv = new LittleEndianDataConverter(); b = new byte[8]; System.arraycopy(buf, 35, b, 0, b.length); conv.getLong(b); newb = new byte[8]; conv.putLong(newb, 0, 12425); block.setLong(BigInteger.valueOf(35), 12425); blockSet.notifyByteEditing(block, BigInteger.valueOf(35), b, newb); for (int i = 0; i < 8; i++) { assertTrue(blockSet.isChanged(block, BigInteger.valueOf(35 + i), b.length)); } }
public void setLong(BigInteger bigIndex, long value) throws ByteBlockAccessException { int index = bigIndex.intValue(); if (index < buf.length) { byte[] b = new byte[8]; converter.putLong(b, 0, value); System.arraycopy(b, 0, buf, index, b.length); } }
FileByteBlock implements ByteBlock { public void setLong(BigInteger bigIndex, long value) throws ByteBlockAccessException { int index = bigIndex.intValue(); if (index < buf.length) { byte[] b = new byte[8]; converter.putLong(b, 0, value); System.arraycopy(b, 0, buf, index, b.length); } } }
FileByteBlock implements ByteBlock { public void setLong(BigInteger bigIndex, long value) throws ByteBlockAccessException { int index = bigIndex.intValue(); if (index < buf.length) { byte[] b = new byte[8]; converter.putLong(b, 0, value); System.arraycopy(b, 0, buf, index, b.length); } } FileByteBlock(byte[] b); }
FileByteBlock implements ByteBlock { public void setLong(BigInteger bigIndex, long value) throws ByteBlockAccessException { int index = bigIndex.intValue(); if (index < buf.length) { byte[] b = new byte[8]; converter.putLong(b, 0, value); System.arraycopy(b, 0, buf, index, b.length); } } FileByteBlock(byte[] b); String getLocationRepresentation(BigInteger bigIndex); int getMaxLocationRepresentationSize(); String getIndexName(); BigInteger getLength(); byte getByte(BigInteger bigIndex); int getInt(BigInteger bigIndex); long getLong(BigInteger bigIndex); void setByte(BigInteger bigIndex, byte value); void setInt(BigInteger bigIndex, int value); void setLong(BigInteger bigIndex, long value); boolean isEditable(); void setBigEndian(boolean bigEndian); boolean isBigEndian(); int getAlignment(int radix); }
FileByteBlock implements ByteBlock { public void setLong(BigInteger bigIndex, long value) throws ByteBlockAccessException { int index = bigIndex.intValue(); if (index < buf.length) { byte[] b = new byte[8]; converter.putLong(b, 0, value); System.arraycopy(b, 0, buf, index, b.length); } } FileByteBlock(byte[] b); String getLocationRepresentation(BigInteger bigIndex); int getMaxLocationRepresentationSize(); String getIndexName(); BigInteger getLength(); byte getByte(BigInteger bigIndex); int getInt(BigInteger bigIndex); long getLong(BigInteger bigIndex); void setByte(BigInteger bigIndex, byte value); void setInt(BigInteger bigIndex, int value); void setLong(BigInteger bigIndex, long value); boolean isEditable(); void setBigEndian(boolean bigEndian); boolean isBigEndian(); int getAlignment(int radix);  }