DataInput skipBytes - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for DataInput skipBytes method.

This code example shows how to use the following methods:skipBytes
        this.input = input;
    } 
 
    public int skipBytes(int n) throws IOException
    { 
        return input.skipBytes(n);
    } 
 
    public int read() throws IOException 
    { 
        return input.readByte() & 0xFF;
    } 
 
    protected void seekInternal(int position)
    { 
        throw new UnsupportedOperationException();
    } 
 
    protected int getPosition() 
    { 
7
CodeRank
This code example shows how to use the following methods:skipBytes
        return i;
    } 
 
    public int skipBytes(int n) throws IOException
    { 
        int skipped = source.skipBytes(n);
        bytesRead += skipped;
        return skipped;
    } 
} 
7
CodeRank
This code example shows how to use the following methods:readUnsignedShort, skipBytes
     
    public SourceFileAttr(ConstantPool cp, String name, int length, DataInput din)
        throws IOException
    { 
        super(cp, name);
        int index = din.readUnsignedShort();
        if ((length -= 2) > 0) {
            din.skipBytes(length);
        } 
        mSourcefile = (ConstantUTFInfo)cp.getConstant(index);
    } 
 
    /** 
     * Returns the source file name. 
     */ 
    public ConstantUTFInfo getFileName() { 
        return mSourcefile;
    } 
     
    /** 
6
CodeRank
This code example shows how to use the following methods:readUnsignedShort, skipBytes
     
    public EnclosingMethodAttr(ConstantPool cp, String name, int length, DataInput din)
        throws IOException
    { 
        super(cp, name);
        mClass = (ConstantClassInfo)cp.getConstant(din.readUnsignedShort());
        mMethod = (ConstantNameAndTypeInfo)cp.getConstant(din.readUnsignedShort());
        if ((length -= 4) > 0) {
            din.skipBytes(length);
        } 
    } 
 
    public ConstantClassInfo getEnclosingClass() { 
        return mClass;
    } 
 
    public ConstantNameAndTypeInfo getEnclosingMethod() { 
        return mMethod;
    } 
 
6
CodeRank
This code example shows how to use the following methods:readUnsignedShort, skipBytes
 
    public ConstantValueAttr(ConstantPool cp, String name, int length, DataInput din)
        throws IOException
    { 
        super(cp, name);
        int index = din.readUnsignedShort();
        if ((length -= 2) > 0) {
            din.skipBytes(length);
        } 
        mConstant = cp.getConstant(index);
    } 
 
    public ConstantInfo getConstant() { 
        return mConstant;
    } 
     
    public int getLength() { 
        return 2; 
    } 
     
6
CodeRank
This code example shows how to use the following methods:readUnsignedShort, skipBytes
     
    public SignatureAttr(ConstantPool cp, String name, int length, DataInput din)
        throws IOException
    { 
        super(cp, name);
        int index = din.readUnsignedShort();
        if ((length -= 2) > 0) {
            din.skipBytes(length);
        } 
        mSignature = (ConstantUTFInfo) cp.getConstant(index);
    } 
 
    /** 
     * Returns the signature. 
     */ 
    public ConstantUTFInfo getSignature() { 
        return mSignature;
    } 
     
    /** 
6
CodeRank
This code example shows how to use the following methods:readInt, skipBytes
 
        return compactClassName(name);
    } 
 
    static void skipFully(DataInput file, int length) throws IOException {
        int total = file.skipBytes(length);
        if (total != length) {
            throw new EOFException();
        } 
    } 
 
    static void swallowFieldOrMethod(DataInput file)
            throws IOException {
        // file.readUnsignedShort(); // Unused access flags 
        // file.readUnsignedShort(); // name index 
        // file.readUnsignedShort(); // signature index 
        skipFully(file, 6);
 
        int attributes_count = file.readUnsignedShort();
        for (int i = 0; i < attributes_count; i++) {

6
CodeRank
This code example shows how to use the following methods:skipBytes
    public DeprecatedAttr(ConstantPool cp, String name, int length, DataInput din)
        throws IOException
    { 
        super(cp, name);
        if (length > 0) {
            din.skipBytes(length);
        } 
    } 
 
    public int getLength() { 
        return 0; 
    } 
} 
5
CodeRank
This code example shows how to use the following methods:skipBytes
    public SyntheticAttr(ConstantPool cp, String name, int length, DataInput din)
        throws IOException
    { 
        super(cp, name);
        if (length > 0) {
            din.skipBytes(length);
        } 
    } 
 
    public int getLength() { 
        return 0; 
    } 
} 
 
5
CodeRank
This code example shows how to use the following methods:readInt, skipBytes
        } 
    } 
 
    @Override 
    public void skip(ObjectInput in) throws IOException {
        int length = in.readInt();
        if (length > 0) {
            in.skipBytes(length << 1);
        } 
    } 
} 
5
CodeRank
skipBytes Method Overview
Makes an attempt to skip over n bytes of data from the input stream, discarding the skipped bytes.
See Code Examples for other Java 8 DataInput Methods: