/** * 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) { this.length = length; this.arrayOut = new CapacityByteArrayOutputStream(initialSize, pageSize); 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.DEBUG) 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 writeFloat(float v) { try { out.writeFloat(v); } catch (IOException e) { throw new ParquetEncodingException("could not write float", 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 BytesInput getBytes() { try { out.flush(); } catch (IOException e) { throw new ParquetEncodingException("could not write page", e); } if (Log.DEBUG) 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 writeFloat(float v) { try { out.writeFloat(v); } catch (IOException e) { throw new ParquetEncodingException("could not write float", e); } }
@Override public final void writeDouble(double v) { try { out.writeDouble(v); } catch (IOException e) { throw new ParquetEncodingException("could not write double", 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)); }
@Override public BytesInput getBytes() { try { out.flush(); } catch (IOException e) { throw new ParquetEncodingException("could not write page", e); } if (Log.DEBUG) LOG.debug("writing a buffer of size " + arrayOut.size()); return BytesInput.from(arrayOut); }
public PlainValuesWriter(int initialSize, int pageSize) { arrayOut = new CapacityByteArrayOutputStream(initialSize, pageSize); out = new LittleEndianDataOutputStream(arrayOut); }
@Override public void writeBytes(Binary v) { try { lengthWriter.writeInteger(v.length()); out.write(v.getBytes()); } catch (IOException e) { throw new ParquetEncodingException("could not write bytes", 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)); }
@Override public BytesInput getBytes() { try { out.flush(); } catch (IOException e) { throw new ParquetEncodingException("could not write page", e); } if (Log.DEBUG) LOG.debug("writing a buffer of size " + arrayOut.size()); return BytesInput.concat(lengthWriter.getBytes(), BytesInput.from(arrayOut)); }
public PlainColumnWriter(int initialSize) { arrayOut = new CapacityByteArrayOutputStream(initialSize); out = new LittleEndianDataOutputStream(arrayOut); }