/** * Converts the float argument to an <code>int</code> using the * <code>floatToIntBits</code> method in class <code>Float</code>, * and then writes that <code>int</code> value to the underlying * output stream as a 4-byte quantity, low byte first. If no * exception is thrown, the counter <code>written</code> is * incremented by <code>4</code>. * * @param v a <code>float</code> value to be written. * @exception IOException if an I/O error occurs. * @see java.io.FilterOutputStream#out * @see java.lang.Float#floatToIntBits(float) */ public final void writeFloat(float v) throws IOException { writeInt(Float.floatToIntBits(v)); }
/** * Converts the double argument to a <code>long</code> using the * <code>doubleToLongBits</code> method in class <code>Double</code>, * and then writes that <code>long</code> value to the underlying * output stream as an 8-byte quantity, low byte first. If no * exception is thrown, the counter <code>written</code> is * incremented by <code>8</code>. * * @param v a <code>double</code> value to be written. * @exception IOException if an I/O error occurs. * @see java.io.FilterOutputStream#out * @see java.lang.Double#doubleToLongBits(double) */ public final void writeDouble(double v) throws IOException { writeLong(Double.doubleToLongBits(v)); }
public FixedLenByteArrayPlainValuesWriter(int length, int initialSize, int pageSize, ByteBufferAllocator allocator) { this.length = length; this.allocator = allocator; this.arrayOut = new CapacityByteArrayOutputStream(initialSize, pageSize, this.allocator); this.out = new LittleEndianDataOutputStream(arrayOut); }
@Override public BytesInput getBytes() { try { out.flush(); } catch (IOException e) { throw new ParquetEncodingException("could not write page", e); } if (LOG.isDebugEnabled()) LOG.debug("writing a buffer of size {}", arrayOut.size()); return BytesInput.from(arrayOut); }
@Override public void writeByte(int value) { try { out.write(value); } catch (IOException e) { throw new ParquetEncodingException("could not write byte", e); } }
@Override public final void writeDouble(double v) { try { out.writeDouble(v); } catch (IOException e) { throw new ParquetEncodingException("could not write double", e); } }
@Override public void close() { arrayOut.close(); out.close(); }
@Override public final void writeFloat(float v) { try { out.writeFloat(v); } catch (IOException e) { throw new ParquetEncodingException("could not write float", e); } }
@Override public BytesInput getBytes() { try { out.flush(); } catch (IOException e) { throw new ParquetEncodingException("could not write page", e); } if (LOG.isDebugEnabled()) LOG.debug("writing a buffer of size {}", arrayOut.size()); return BytesInput.from(arrayOut); }
@Override public void writeByte(int value) { try { out.write(value); } catch (IOException e) { throw new ParquetEncodingException("could not write byte", e); } }
@Override public final void writeDouble(double v) { try { out.writeDouble(v); } catch (IOException e) { throw new ParquetEncodingException("could not write double", e); } }
@Override public void close() { arrayOut.close(); out.close(); }
@Override public final void writeFloat(float v) { try { out.writeFloat(v); } catch (IOException e) { throw new ParquetEncodingException("could not write float", e); } }
/** * Converts the float argument to an <code>int</code> using the * <code>floatToIntBits</code> method in class <code>Float</code>, * and then writes that <code>int</code> value to the underlying * output stream as a 4-byte quantity, low byte first. If no * exception is thrown, the counter <code>written</code> is * incremented by <code>4</code>. * * @param v a <code>float</code> value to be written. * @exception IOException if an I/O error occurs. * @see java.io.FilterOutputStream#out * @see java.lang.Float#floatToIntBits(float) */ public final void writeFloat(float v) throws IOException { writeInt(Float.floatToIntBits(v)); }
/** * Converts the double argument to a <code>long</code> using the * <code>doubleToLongBits</code> method in class <code>Double</code>, * and then writes that <code>long</code> value to the underlying * output stream as an 8-byte quantity, low byte first. If no * exception is thrown, the counter <code>written</code> is * incremented by <code>8</code>. * * @param v a <code>double</code> value to be written. * @exception IOException if an I/O error occurs. * @see java.io.FilterOutputStream#out * @see java.lang.Double#doubleToLongBits(double) */ public final void writeDouble(double v) throws IOException { writeLong(Double.doubleToLongBits(v)); }
public FixedLenByteArrayPlainValuesWriter(int length, int initialSize, int pageSize, ByteBufferAllocator allocator) { this.length = length; this.allocator = allocator; this.arrayOut = new CapacityByteArrayOutputStream(initialSize, pageSize, this.allocator); this.out = new LittleEndianDataOutputStream(arrayOut); }
@Override public BytesInput getBytes() { try { out.flush(); } catch (IOException e) { throw new ParquetEncodingException("could not write page", e); } LOG.debug("writing a buffer of size {}", arrayOut.size()); return BytesInput.from(arrayOut); }
@Override public final void writeInteger(int v) { try { out.writeInt(v); } catch (IOException e) { throw new ParquetEncodingException("could not write int", e); } }
@Override public final void writeLong(long v) { try { out.writeLong(v); } catch (IOException e) { throw new ParquetEncodingException("could not write long", e); } }
public PlainValuesWriter(int initialSize, int pageSize, ByteBufferAllocator allocator) { arrayOut = new CapacityByteArrayOutputStream(initialSize, pageSize, allocator); out = new LittleEndianDataOutputStream(arrayOut); }