Example usage for java.io DataInput readInt

List of usage examples for java.io DataInput readInt

Introduction

In this page you can find the example usage for java.io DataInput readInt.

Prototype

int readInt() throws IOException;

Source Link

Document

Reads four input bytes and returns an int value.

Usage

From source file:org.apache.hadoop.mapred.JTAddress.java

public void readFields(DataInput in) throws IOException {
    String hostname = in.readUTF();
    int port = in.readInt();

    if (hostname == null || hostname.length() == 0) {
        address = null;/*w w  w.  ja v a  2  s  .  c  om*/
        stringValue = null;
    } else {
        address = new InetSocketAddress(hostname, port);
        stringValue = hostname + ":" + port;
        checkBindAddressCanBeResolved();
    }
}

From source file:org.apache.hadoop.hbase.HServerAddress.java

public void readFields(DataInput in) throws IOException {
    String hostname = in.readUTF();
    int port = in.readInt();
    if (hostname != null && hostname.length() > 0) {
        this.address = getResolvedAddress(new InetSocketAddress(hostname, port));
        checkBindAddressCanBeResolved();
        createCachedToString();/*ww  w .  ja  va 2  s  . com*/
    }
}

From source file:org.kiji.schema.mapreduce.KijiPut.java

/** {@inheritDoc} */
@Override/*from  ww w. j  ava  2s . c om*/
public void readFields(DataInput in) throws IOException {
    // EntityId.
    final byte[] bytes = new byte[in.readInt()];
    in.readFully(bytes);
    mEntityId = new HBaseEntityId(bytes);

    // Family/Qualifier/Timestamp.
    mFamily = in.readUTF();
    mQualifier = in.readUTF();
    mTimestamp = in.readLong();

    // Avro.
    final Schema schema = new Schema.Parser().parse(in.readUTF());
    final KijiCellDecoderFactory decoderFactory = new SpecificCellDecoderFactory(null);
    final KijiCellDecoder<?> decoder = decoderFactory.create(schema, KijiCellFormat.NONE);
    final byte[] cellData = new byte[in.readInt()];
    in.readFully(cellData);
    mCell = decoder.decode(cellData, null);
}

From source file:jadx.core.utils.android.Res9patchStreamDecoder.java

private void find9patchChunk(DataInput di) throws JadxException, IOException {
    di.skipBytes(8);/*w w  w. ja va2s . c  o m*/
    while (true) {
        int size;
        try {
            size = di.readInt();
        } catch (IOException ex) {
            throw new JadxException("Cant find nine patch chunk", ex);
        }
        if (di.readInt() == NP_CHUNK_TYPE) {
            return;
        }
        di.skipBytes(size + 4);
    }
}

From source file:org.apache.hadoop.io.BytesWritable.java

public void readFields(DataInput in) throws IOException {
    setSize(0); // clear the old data
    setSize(in.readInt());
    in.readFully(bytes, 0, size);//w  ww. j a  va  2  s.co m
}

From source file:brut.androlib.res.decoder.Res9patchStreamDecoder.java

private void find9patchChunk(DataInput di) throws AndrolibException, IOException {
    di.skipBytes(8);//from   w  w  w .j  av a  2s  .  c o m
    while (true) {
        int size;
        try {
            size = di.readInt();
        } catch (IOException ex) {
            throw new CantFind9PatchChunk("Cant find nine patch chunk", ex);
        }
        if (di.readInt() == NP_CHUNK_TYPE) {
            return;
        }
        di.skipBytes(size + 4);
    }
}

From source file:edu.umn.cs.spatialHadoop.core.OGCESRIShape.java

@Override
public void readFields(DataInput in) throws IOException {
    int size = in.readInt();
    byte[] bytes = new byte[size];
    in.readFully(bytes);//w ww .  ja  v  a 2s  .  c om
    geom = OGCGeometry.fromBinary(ByteBuffer.wrap(bytes));
}

From source file:org.apache.hadoop.hive.ql.io.BucketizedHiveInputSplit.java

@Override
public void readFields(DataInput in) throws IOException {
    String inputSplitClassName = in.readUTF();

    int numSplits = in.readInt();
    inputSplits = new InputSplit[numSplits];
    for (int i = 0; i < numSplits; i++) {
        try {//from ww w  .ja v a  2  s.co  m
            inputSplits[i] = (InputSplit) ReflectionUtils.newInstance(conf.getClassByName(inputSplitClassName),
                    conf);
        } catch (Exception e) {
            throw new IOException("Cannot create an instance of InputSplit class = " + inputSplitClassName + ":"
                    + e.getMessage());
        }
        inputSplits[i].readFields(in);
    }
    inputFormatClassName = in.readUTF();
}

From source file:org.apache.hama.bsp.Task.java

@Override
public void readFields(DataInput in) throws IOException {
    jobId.readFields(in);/*from ww w  . j  av a 2s  .  co  m*/
    jobFile = Text.readString(in);
    taskId.readFields(in);
    partition = in.readInt();
}

From source file:com.kylinolap.dict.DateStrDictionary.java

@Override
public void readFields(DataInput in) throws IOException {
    String pattern = in.readUTF();
    int baseId = in.readInt();
    init(pattern, baseId);/*from   w  w  w  .  j a va 2 s.c  om*/
}