public final void writeDouble(double d) throws IOException { this.writeLong(Double.doubleToLongBits(d)); }
public final void writeDouble(double d) throws IOException { this.writeLong(Double.doubleToLongBits(d)); }
public final void writeDouble(double d) throws IOException { this.writeLong(Double.doubleToLongBits(d)); }
private void writeLinearIndex(final LinearIndex linearIndex, final LittleEndianOutputStream los) throws IOException { if (linearIndex.getIndexStart() != 0) { // This could be handled by writing zeroes, but it is not expected so just fail. throw new IllegalArgumentException("Non-zero linear index start"); } final long[] entries = linearIndex.getIndexEntries(); los.writeInt(entries.length); for (final long entry : entries) los.writeLong(entry); }
private void writeLinearIndex(final LinearIndex linearIndex, final LittleEndianOutputStream los) throws IOException { if (linearIndex.getIndexStart() != 0) { // This could be handled by writing zeroes, but it is not expected so just fail. throw new IllegalArgumentException("Non-zero linear index start"); } final long[] entries = linearIndex.getIndexEntries(); los.writeInt(entries.length); for (final long entry : entries) los.writeLong(entry); }
private void writeLinearIndex(final LinearIndex linearIndex, final LittleEndianOutputStream los) throws IOException { if (linearIndex.getIndexStart() != 0) { // This could be handled by writing zeroes, but it is not expected so just fail. throw new IllegalArgumentException("Non-zero linear index start"); } final long[] entries = linearIndex.getIndexEntries(); los.writeInt(entries.length); for (final long entry : entries) los.writeLong(entry); }
private void writeBin(final Bin bin, final LittleEndianOutputStream los) throws IOException { los.writeInt(bin.getBinNumber()); final List<Chunk> chunkList = bin.getChunkList(); los.writeInt(chunkList.size()); for (final Chunk chunk : chunkList) { los.writeLong(chunk.getChunkStart()); los.writeLong(chunk.getChunkEnd()); } }
private void writeBin(final Bin bin, final LittleEndianOutputStream los) throws IOException { los.writeInt(bin.getBinNumber()); final List<Chunk> chunkList = bin.getChunkList(); los.writeInt(chunkList.size()); for (final Chunk chunk : chunkList) { los.writeLong(chunk.getChunkStart()); los.writeLong(chunk.getChunkEnd()); } }
private void writeBin(final Bin bin, final LittleEndianOutputStream los) throws IOException { los.writeInt(bin.getBinNumber()); final List<Chunk> chunkList = bin.getChunkList(); los.writeInt(chunkList.size()); for (final Chunk chunk: chunkList) { los.writeLong(chunk.getChunkStart()); los.writeLong(chunk.getChunkEnd()); } }
/** * write the header to the target output stream * * @param dos the little endian output stream * @throws IOException an exception when we can't write to the file */ private void writeHeader(final LittleEndianOutputStream dos) throws IOException { dos.writeInt(MAGIC_NUMBER); dos.writeInt(getType()); dos.writeInt(version); dos.writeString(indexedPath.toUri().toString()); dos.writeLong(indexedFileSize); dos.writeLong(indexedFileTS); dos.writeString(indexedFileMD5); dos.writeInt(flags); // Properties (Version 3 and later) dos.writeInt(properties.size()); for (final Map.Entry<String, String> prop : properties.entrySet()) { dos.writeString(prop.getKey()); dos.writeString(prop.getValue()); } }
/** * write the header to the target output stream * * @param dos the little endian output stream * @throws IOException an exception when we can't write to the file */ private void writeHeader(final LittleEndianOutputStream dos) throws IOException { dos.writeInt(MAGIC_NUMBER); dos.writeInt(getType()); dos.writeInt(version); dos.writeString(indexedPath.toUri().toString()); dos.writeLong(indexedFileSize); dos.writeLong(indexedFileTS); dos.writeString(indexedFileMD5); dos.writeInt(flags); // Properties (Version 3 and later) dos.writeInt(properties.size()); for (final Map.Entry<String, String> prop : properties.entrySet()) { dos.writeString(prop.getKey()); dos.writeString(prop.getValue()); } }
/** * write the header to the target output stream * * @param dos the little endian output stream * @throws IOException an exception when we can't write to the file */ private void writeHeader(final LittleEndianOutputStream dos) throws IOException { dos.writeInt(MAGIC_NUMBER); dos.writeInt(getType()); dos.writeInt(version); dos.writeString(indexedFile.getAbsolutePath()); dos.writeLong(indexedFileSize); dos.writeLong(indexedFileTS); dos.writeString(indexedFileMD5); dos.writeInt(flags); // Properties (Version 3 and later) dos.writeInt(properties.size()); for (final Map.Entry<String, String> prop : properties.entrySet()) { dos.writeString(prop.getKey()); dos.writeString(prop.getValue()); } }
public void write(final LittleEndianOutputStream dos) throws IOException { // Chr name, binSize, # bins, longest feature dos.writeString(name); dos.writeInt(binWidth); dos.writeInt(blocks.size()); dos.writeInt(longestFeature); dos.writeInt(0); // no longer used //dos.writeInt(largestBlockSize); dos.writeInt(nFeatures); long pos = 0; long size = 0; for (final Block block : blocks) { pos = block.getStartPosition(); size = block.getSize(); dos.writeLong(pos); } // End of last block for this chromosome dos.writeLong(pos + size); }
@Override public void write(final LittleEndianOutputStream dos) throws IOException { // Chr name, binSize, # bins, longest feature dos.writeString(name); dos.writeInt(binWidth); dos.writeInt(blocks.size()); dos.writeInt(longestFeature); dos.writeInt(0); // no longer used //dos.writeInt(largestBlockSize); dos.writeInt(nFeatures); long pos = 0; long size = 0; for (final Block block : blocks) { pos = block.getStartPosition(); size = block.getSize(); dos.writeLong(pos); } // End of last block for this chromosome dos.writeLong(pos + size); }
@Override public void write(final LittleEndianOutputStream dos) throws IOException { // Chr name, binSize, # bins, longest feature dos.writeString(name); dos.writeInt(binWidth); dos.writeInt(blocks.size()); dos.writeInt(longestFeature); dos.writeInt(0); // no longer used //dos.writeInt(largestBlockSize); dos.writeInt(nFeatures); long pos = 0; long size = 0; for (final Block block : blocks) { pos = block.getStartPosition(); size = block.getSize(); dos.writeLong(pos); } // End of last block for this chromosome dos.writeLong(pos + size); }
@Override public void write(final LittleEndianOutputStream dos) throws IOException { dos.writeString(name); final List<Interval> intervals = tree.getIntervals(); dos.writeInt(intervals.size()); for (final Interval interval : intervals) { dos.writeInt(interval.start); dos.writeInt(interval.end); dos.writeLong(interval.getBlock().getStartPosition()); dos.writeInt((int) interval.getBlock().getSize()); } }
static void createTestFile() throws IOException { LittleEndianOutputStream los = new LittleEndianOutputStream(new BufferedOutputStream(new FileOutputStream("les_test.bin"))); los.writeString("Binary test file"); los.writeFloat(Float.MAX_VALUE); los.writeByte(Byte.MAX_VALUE); los.writeShort(Short.MAX_VALUE); los.writeInt(Integer.MAX_VALUE); los.writeLong(Long.MAX_VALUE); los.writeDouble(Double.MAX_VALUE); los.close(); } }
@Override public void write(final LittleEndianOutputStream dos) throws IOException { dos.writeString(name); final List<Interval> intervals = tree.getIntervals(); dos.writeInt(intervals.size()); for (final Interval interval : intervals) { dos.writeInt(interval.start); dos.writeInt(interval.end); dos.writeLong(interval.getBlock().getStartPosition()); dos.writeInt((int) interval.getBlock().getSize()); } }
public void write(final LittleEndianOutputStream dos) throws IOException { dos.writeString(name); final List<Interval> intervals = tree.getIntervals(); dos.writeInt(intervals.size()); for (final Interval interval : intervals) { dos.writeInt(interval.start); dos.writeInt(interval.end); dos.writeLong(interval.getBlock().getStartPosition()); dos.writeInt((int)interval.getBlock().getSize()); } }