Example usage for java.io DataOutput write

List of usage examples for java.io DataOutput write

Introduction

In this page you can find the example usage for java.io DataOutput write.

Prototype

void write(byte b[], int off, int len) throws IOException;

Source Link

Document

Writes len bytes from array b, in order, to the output stream.

Usage

From source file:org.godhuli.rhipe.RHBytesWritable.java

public void writeAsInt(final DataOutput out) throws IOException {
    out.writeInt(size);/*from  w ww  .  j a  va  2  s .  c o  m*/
    out.write(bytes, 0, size);
}

From source file:org.kalypso.shape.dbf.DBFField.java

@Override
public byte[] writeValue(final DataOutput output, final Object value, final Charset charset)
        throws DBaseException, IOException {
    final byte[] bytes = m_formatter.toBytes(value, charset);

    final int bytesToWrite = Math.min(bytes.length, m_fieldLength);

    output.write(bytes, 0, bytesToWrite);

    for (int j = bytesToWrite; j < m_fieldLength; j++)
        output.writeByte((byte) 0x20);

    return bytes;
}

From source file:org.lwes.ArrayEvent.java

@Override
public int serialize(DataOutput output) throws IOException {
    output.write(this.bytes, 0, length);
    return length;
}

From source file:uk.bl.wa.hadoop.WritableArchiveRecord.java

@Override
public void write(DataOutput output) throws IOException {
    log.debug("Calling write( DataOutput )...");
    if (record != null) {
        int ch;/* ww w.  j av a  2 s. c o m*/
        byte[] buffer = new byte[BUFFER_SIZE];
        while ((ch = record.read(buffer)) >= 0) {
            output.write(buffer, 0, ch);
        }
    }
}