@Override public void write(final int value, final OutputStream out) throws IOException { INT32.write(value, out); } },
@Override public void write(final int value, final OutputStream out) throws IOException { INT8.write(value, out); } };
@Override public void write(final int value, final OutputStream out) throws IOException { INT8.write(value, out); } };
@Override public void write(final int value, final OutputStream out) throws IOException { INT32.write(value, out); } },
@Override public void write(final int value, final OutputStream out) throws IOException { INT32.write(value, out); } },
@Override public void write(final int value, final OutputStream out) throws IOException { INT8.write(value, out); } };
public final void encodeRawBytes(final int value, final BCF2Type type) throws IOException { type.write(value, encodeStream); }
public final void encodeRawInt(final int value, final BCF2Type type) throws IOException { type.write(value, encodeStream); }
public final void encodeRawInt(final int value, final BCF2Type type) throws IOException { type.write(value, encodeStream); }
public final void encodeRawBytes(final int value, final BCF2Type type) throws IOException { type.write(value, encodeStream); }
/** * Write the data in the encoder to the outputstream as a length encoded * block of data. After this call the encoder stream will be ready to * start a new data block * * @throws IOException */ private void writeBlock(final byte[] infoBlock, final byte[] genotypesBlock) throws IOException { BCF2Type.INT32.write(infoBlock.length, outputStream); BCF2Type.INT32.write(genotypesBlock.length, outputStream); outputStream.write(infoBlock); outputStream.write(genotypesBlock); }
/** * Write the data in the encoder to the outputstream as a length encoded * block of data. After this call the encoder stream will be ready to * start a new data block * * @throws IOException */ private void writeBlock(final byte[] infoBlock, final byte[] genotypesBlock) throws IOException { BCF2Type.INT32.write(infoBlock.length, outputStream); BCF2Type.INT32.write(genotypesBlock.length, outputStream); outputStream.write(infoBlock); outputStream.write(genotypesBlock); }
/** * Write the data in the encoder to the outputstream as a length encoded * block of data. After this call the encoder stream will be ready to * start a new data block * * @throws IOException */ @Requires({"infoBlock.length > 0", "genotypesBlock.length >= 0"}) private void writeBlock(final byte[] infoBlock, final byte[] genotypesBlock) throws IOException { BCF2Type.INT32.write(infoBlock.length, outputStream); BCF2Type.INT32.write(genotypesBlock.length, outputStream); outputStream.write(infoBlock); outputStream.write(genotypesBlock); }
@Ensures("encodeStream.size() > old(encodeStream.size())") public final void encodeRawInt(final int value, final BCF2Type type) throws IOException { type.write(value, encodeStream); }
@Ensures("encodeStream.size() > old(encodeStream.size())") public final void encodeRawBytes(final int value, final BCF2Type type) throws IOException { type.write(value, encodeStream); }
@Override public void writeHeader(VCFHeader header) { setHeader(header); try { // write out the header into a byte stream, get its length, and write everything to the file final ByteArrayOutputStream capture = new ByteArrayOutputStream(); final OutputStreamWriter writer = new OutputStreamWriter(capture); this.header = VCFWriter.writeHeader(this.header, writer, VCFWriter.getVersionLine(), "BCF2 stream"); writer.append('\0'); // the header is null terminated by a byte writer.close(); final byte[] headerBytes = capture.toByteArray(); new BCFVersion(MAJOR_VERSION, MINOR_VERSION).write(outputStream); BCF2Type.INT32.write(headerBytes.length, outputStream); outputStream.write(headerBytes); outputHasBeenWritten = true; } catch (IOException e) { throw new RuntimeIOException("BCF2 stream: Got IOException while trying to write BCF2 header", e); } }
@Override public void writeHeader(VCFHeader header) { setHeader(header); try { // write out the header into a byte stream, get its length, and write everything to the file final ByteArrayOutputStream capture = new ByteArrayOutputStream(); final OutputStreamWriter writer = new OutputStreamWriter(capture); this.header = VCFWriter.writeHeader(this.header, writer, VCFWriter.getVersionLine(), "BCF2 stream"); writer.append('\0'); // the header is null terminated by a byte writer.close(); final byte[] headerBytes = capture.toByteArray(); new BCFVersion(MAJOR_VERSION, MINOR_VERSION).write(outputStream); BCF2Type.INT32.write(headerBytes.length, outputStream); outputStream.write(headerBytes); outputHasBeenWritten = true; } catch (IOException e) { throw new RuntimeIOException("BCF2 stream: Got IOException while trying to write BCF2 header", e); } }
BCF2Type.INT32.write(headerBytes.length, outputStream); outputStream.write(headerBytes); } catch (IOException e) {