Java Code Examples for com.sun.corba.se.impl.encoding.TypeCodeReader#getTopLevelPosition()

The following examples show how to use com.sun.corba.se.impl.encoding.TypeCodeReader#getTopLevelPosition() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TypeCodeImpl.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
boolean read_value_kind(TypeCodeReader tcis)
{
    _kind = tcis.read_long();

    // Bug fix 5034649: allow for padding that precedes the typecode kind.
    int myPosition = tcis.getTopLevelPosition()-4;

    // check validity of kind
    if ((_kind < 0 || _kind > typeTable.length) && _kind != tk_indirect) {
        throw wrapper.cannotMarshalBadTckind() ;
    }

    // Don't do any work if this is native
    if (_kind == TCKind._tk_native)
        throw wrapper.cannotMarshalNative() ;

    // We have to remember the stream and position for EVERY type code
    // in case some recursive or indirect type code references it.
    TypeCodeReader topStream = tcis.getTopLevelStream();

    if (_kind == tk_indirect) {
        int streamOffset = tcis.read_long();
        if (streamOffset > -4)
            throw wrapper.invalidIndirection( new Integer(streamOffset) ) ;

        // The encoding used for indirection is the same as that used for recursive ,
        // TypeCodes i.e., a 0xffffffff indirection marker followed by a long offset
        // (in units of octets) from the beginning of the long offset.
        int topPos = tcis.getTopLevelPosition();
        // substract 4 to get back to the beginning of the long offset.
        int indirectTypePosition = topPos - 4 + streamOffset;

        // Now we have to find the referenced type
        // by its indirectTypePosition within topStream.
        //if (debug) System.out.println(
        // "TypeCodeImpl looking up indirection at position topPos " +
        //topPos + " - 4 + offset " + streamOffset + " = " + indirectTypePosition);
        TypeCodeImpl type = topStream.getTypeCodeAtPosition(indirectTypePosition);
        if (type == null)
            throw wrapper.indirectionNotFound( new Integer(indirectTypePosition) ) ;
        setIndirectType(type);
        return false;
    }

    topStream.addTypeCodeAtPosition(this, myPosition);
    return true;
}
 
Example 2
Source File: TypeCodeImpl.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
boolean read_value_kind(TypeCodeReader tcis)
{
    _kind = tcis.read_long();

    // Bug fix 5034649: allow for padding that precedes the typecode kind.
    int myPosition = tcis.getTopLevelPosition()-4;

    // check validity of kind
    if ((_kind < 0 || _kind > typeTable.length) && _kind != tk_indirect) {
        throw wrapper.cannotMarshalBadTckind() ;
    }

    // Don't do any work if this is native
    if (_kind == TCKind._tk_native)
        throw wrapper.cannotMarshalNative() ;

    // We have to remember the stream and position for EVERY type code
    // in case some recursive or indirect type code references it.
    TypeCodeReader topStream = tcis.getTopLevelStream();

    if (_kind == tk_indirect) {
        int streamOffset = tcis.read_long();
        if (streamOffset > -4)
            throw wrapper.invalidIndirection( new Integer(streamOffset) ) ;

        // The encoding used for indirection is the same as that used for recursive ,
        // TypeCodes i.e., a 0xffffffff indirection marker followed by a long offset
        // (in units of octets) from the beginning of the long offset.
        int topPos = tcis.getTopLevelPosition();
        // substract 4 to get back to the beginning of the long offset.
        int indirectTypePosition = topPos - 4 + streamOffset;

        // Now we have to find the referenced type
        // by its indirectTypePosition within topStream.
        //if (debug) System.out.println(
        // "TypeCodeImpl looking up indirection at position topPos " +
        //topPos + " - 4 + offset " + streamOffset + " = " + indirectTypePosition);
        TypeCodeImpl type = topStream.getTypeCodeAtPosition(indirectTypePosition);
        if (type == null)
            throw wrapper.indirectionNotFound( new Integer(indirectTypePosition) ) ;
        setIndirectType(type);
        return false;
    }

    topStream.addTypeCodeAtPosition(this, myPosition);
    return true;
}
 
Example 3
Source File: TypeCodeImpl.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
boolean read_value_kind(TypeCodeReader tcis)
{
    _kind = tcis.read_long();

    // Bug fix 5034649: allow for padding that precedes the typecode kind.
    int myPosition = tcis.getTopLevelPosition()-4;

    // check validity of kind
    if ((_kind < 0 || _kind > typeTable.length) && _kind != tk_indirect) {
        throw wrapper.cannotMarshalBadTckind() ;
    }

    // Don't do any work if this is native
    if (_kind == TCKind._tk_native)
        throw wrapper.cannotMarshalNative() ;

    // We have to remember the stream and position for EVERY type code
    // in case some recursive or indirect type code references it.
    TypeCodeReader topStream = tcis.getTopLevelStream();

    if (_kind == tk_indirect) {
        int streamOffset = tcis.read_long();
        if (streamOffset > -4)
            throw wrapper.invalidIndirection( new Integer(streamOffset) ) ;

        // The encoding used for indirection is the same as that used for recursive ,
        // TypeCodes i.e., a 0xffffffff indirection marker followed by a long offset
        // (in units of octets) from the beginning of the long offset.
        int topPos = tcis.getTopLevelPosition();
        // substract 4 to get back to the beginning of the long offset.
        int indirectTypePosition = topPos - 4 + streamOffset;

        // Now we have to find the referenced type
        // by its indirectTypePosition within topStream.
        //if (debug) System.out.println(
        // "TypeCodeImpl looking up indirection at position topPos " +
        //topPos + " - 4 + offset " + streamOffset + " = " + indirectTypePosition);
        TypeCodeImpl type = topStream.getTypeCodeAtPosition(indirectTypePosition);
        if (type == null)
            throw wrapper.indirectionNotFound( new Integer(indirectTypePosition) ) ;
        setIndirectType(type);
        return false;
    }

    topStream.addTypeCodeAtPosition(this, myPosition);
    return true;
}
 
Example 4
Source File: TypeCodeImpl.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
boolean read_value_kind(TypeCodeReader tcis)
{
    _kind = tcis.read_long();

    // Bug fix 5034649: allow for padding that precedes the typecode kind.
    int myPosition = tcis.getTopLevelPosition()-4;

    // check validity of kind
    if ((_kind < 0 || _kind > typeTable.length) && _kind != tk_indirect) {
        throw wrapper.cannotMarshalBadTckind() ;
    }

    // Don't do any work if this is native
    if (_kind == TCKind._tk_native)
        throw wrapper.cannotMarshalNative() ;

    // We have to remember the stream and position for EVERY type code
    // in case some recursive or indirect type code references it.
    TypeCodeReader topStream = tcis.getTopLevelStream();

    if (_kind == tk_indirect) {
        int streamOffset = tcis.read_long();
        if (streamOffset > -4)
            throw wrapper.invalidIndirection( new Integer(streamOffset) ) ;

        // The encoding used for indirection is the same as that used for recursive ,
        // TypeCodes i.e., a 0xffffffff indirection marker followed by a long offset
        // (in units of octets) from the beginning of the long offset.
        int topPos = tcis.getTopLevelPosition();
        // substract 4 to get back to the beginning of the long offset.
        int indirectTypePosition = topPos - 4 + streamOffset;

        // Now we have to find the referenced type
        // by its indirectTypePosition within topStream.
        //if (debug) System.out.println(
        // "TypeCodeImpl looking up indirection at position topPos " +
        //topPos + " - 4 + offset " + streamOffset + " = " + indirectTypePosition);
        TypeCodeImpl type = topStream.getTypeCodeAtPosition(indirectTypePosition);
        if (type == null)
            throw wrapper.indirectionNotFound( new Integer(indirectTypePosition) ) ;
        setIndirectType(type);
        return false;
    }

    topStream.addTypeCodeAtPosition(this, myPosition);
    return true;
}
 
Example 5
Source File: TypeCodeImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
boolean read_value_kind(TypeCodeReader tcis)
{
    _kind = tcis.read_long();

    // Bug fix 5034649: allow for padding that precedes the typecode kind.
    int myPosition = tcis.getTopLevelPosition()-4;

    // check validity of kind
    if ((_kind < 0 || _kind > typeTable.length) && _kind != tk_indirect) {
        throw wrapper.cannotMarshalBadTckind() ;
    }

    // Don't do any work if this is native
    if (_kind == TCKind._tk_native)
        throw wrapper.cannotMarshalNative() ;

    // We have to remember the stream and position for EVERY type code
    // in case some recursive or indirect type code references it.
    TypeCodeReader topStream = tcis.getTopLevelStream();

    if (_kind == tk_indirect) {
        int streamOffset = tcis.read_long();
        if (streamOffset > -4)
            throw wrapper.invalidIndirection( new Integer(streamOffset) ) ;

        // The encoding used for indirection is the same as that used for recursive ,
        // TypeCodes i.e., a 0xffffffff indirection marker followed by a long offset
        // (in units of octets) from the beginning of the long offset.
        int topPos = tcis.getTopLevelPosition();
        // substract 4 to get back to the beginning of the long offset.
        int indirectTypePosition = topPos - 4 + streamOffset;

        // Now we have to find the referenced type
        // by its indirectTypePosition within topStream.
        //if (debug) System.out.println(
        // "TypeCodeImpl looking up indirection at position topPos " +
        //topPos + " - 4 + offset " + streamOffset + " = " + indirectTypePosition);
        TypeCodeImpl type = topStream.getTypeCodeAtPosition(indirectTypePosition);
        if (type == null)
            throw wrapper.indirectionNotFound( new Integer(indirectTypePosition) ) ;
        setIndirectType(type);
        return false;
    }

    topStream.addTypeCodeAtPosition(this, myPosition);
    return true;
}
 
Example 6
Source File: TypeCodeImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
boolean read_value_kind(TypeCodeReader tcis)
{
    _kind = tcis.read_long();

    // Bug fix 5034649: allow for padding that precedes the typecode kind.
    int myPosition = tcis.getTopLevelPosition()-4;

    // check validity of kind
    if ((_kind < 0 || _kind > typeTable.length) && _kind != tk_indirect) {
        throw wrapper.cannotMarshalBadTckind() ;
    }

    // Don't do any work if this is native
    if (_kind == TCKind._tk_native)
        throw wrapper.cannotMarshalNative() ;

    // We have to remember the stream and position for EVERY type code
    // in case some recursive or indirect type code references it.
    TypeCodeReader topStream = tcis.getTopLevelStream();

    if (_kind == tk_indirect) {
        int streamOffset = tcis.read_long();
        if (streamOffset > -4)
            throw wrapper.invalidIndirection( new Integer(streamOffset) ) ;

        // The encoding used for indirection is the same as that used for recursive ,
        // TypeCodes i.e., a 0xffffffff indirection marker followed by a long offset
        // (in units of octets) from the beginning of the long offset.
        int topPos = tcis.getTopLevelPosition();
        // substract 4 to get back to the beginning of the long offset.
        int indirectTypePosition = topPos - 4 + streamOffset;

        // Now we have to find the referenced type
        // by its indirectTypePosition within topStream.
        //if (debug) System.out.println(
        // "TypeCodeImpl looking up indirection at position topPos " +
        //topPos + " - 4 + offset " + streamOffset + " = " + indirectTypePosition);
        TypeCodeImpl type = topStream.getTypeCodeAtPosition(indirectTypePosition);
        if (type == null)
            throw wrapper.indirectionNotFound( new Integer(indirectTypePosition) ) ;
        setIndirectType(type);
        return false;
    }

    topStream.addTypeCodeAtPosition(this, myPosition);
    return true;
}
 
Example 7
Source File: TypeCodeImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
boolean read_value_kind(TypeCodeReader tcis)
{
    _kind = tcis.read_long();

    // Bug fix 5034649: allow for padding that precedes the typecode kind.
    int myPosition = tcis.getTopLevelPosition()-4;

    // check validity of kind
    if ((_kind < 0 || _kind > typeTable.length) && _kind != tk_indirect) {
        throw wrapper.cannotMarshalBadTckind() ;
    }

    // Don't do any work if this is native
    if (_kind == TCKind._tk_native)
        throw wrapper.cannotMarshalNative() ;

    // We have to remember the stream and position for EVERY type code
    // in case some recursive or indirect type code references it.
    TypeCodeReader topStream = tcis.getTopLevelStream();

    if (_kind == tk_indirect) {
        int streamOffset = tcis.read_long();
        if (streamOffset > -4)
            throw wrapper.invalidIndirection( new Integer(streamOffset) ) ;

        // The encoding used for indirection is the same as that used for recursive ,
        // TypeCodes i.e., a 0xffffffff indirection marker followed by a long offset
        // (in units of octets) from the beginning of the long offset.
        int topPos = tcis.getTopLevelPosition();
        // substract 4 to get back to the beginning of the long offset.
        int indirectTypePosition = topPos - 4 + streamOffset;

        // Now we have to find the referenced type
        // by its indirectTypePosition within topStream.
        //if (debug) System.out.println(
        // "TypeCodeImpl looking up indirection at position topPos " +
        //topPos + " - 4 + offset " + streamOffset + " = " + indirectTypePosition);
        TypeCodeImpl type = topStream.getTypeCodeAtPosition(indirectTypePosition);
        if (type == null)
            throw wrapper.indirectionNotFound( new Integer(indirectTypePosition) ) ;
        setIndirectType(type);
        return false;
    }

    topStream.addTypeCodeAtPosition(this, myPosition);
    return true;
}
 
Example 8
Source File: TypeCodeImpl.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
boolean read_value_kind(TypeCodeReader tcis)
{
    _kind = tcis.read_long();

    // Bug fix 5034649: allow for padding that precedes the typecode kind.
    int myPosition = tcis.getTopLevelPosition()-4;

    // check validity of kind
    if ((_kind < 0 || _kind > typeTable.length) && _kind != tk_indirect) {
        throw wrapper.cannotMarshalBadTckind() ;
    }

    // Don't do any work if this is native
    if (_kind == TCKind._tk_native)
        throw wrapper.cannotMarshalNative() ;

    // We have to remember the stream and position for EVERY type code
    // in case some recursive or indirect type code references it.
    TypeCodeReader topStream = tcis.getTopLevelStream();

    if (_kind == tk_indirect) {
        int streamOffset = tcis.read_long();
        if (streamOffset > -4)
            throw wrapper.invalidIndirection( new Integer(streamOffset) ) ;

        // The encoding used for indirection is the same as that used for recursive ,
        // TypeCodes i.e., a 0xffffffff indirection marker followed by a long offset
        // (in units of octets) from the beginning of the long offset.
        int topPos = tcis.getTopLevelPosition();
        // substract 4 to get back to the beginning of the long offset.
        int indirectTypePosition = topPos - 4 + streamOffset;

        // Now we have to find the referenced type
        // by its indirectTypePosition within topStream.
        //if (debug) System.out.println(
        // "TypeCodeImpl looking up indirection at position topPos " +
        //topPos + " - 4 + offset " + streamOffset + " = " + indirectTypePosition);
        TypeCodeImpl type = topStream.getTypeCodeAtPosition(indirectTypePosition);
        if (type == null)
            throw wrapper.indirectionNotFound( new Integer(indirectTypePosition) ) ;
        setIndirectType(type);
        return false;
    }

    topStream.addTypeCodeAtPosition(this, myPosition);
    return true;
}
 
Example 9
Source File: TypeCodeImpl.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
boolean read_value_kind(TypeCodeReader tcis)
{
    _kind = tcis.read_long();

    // Bug fix 5034649: allow for padding that precedes the typecode kind.
    int myPosition = tcis.getTopLevelPosition()-4;

    // check validity of kind
    if ((_kind < 0 || _kind > typeTable.length) && _kind != tk_indirect) {
        throw wrapper.cannotMarshalBadTckind() ;
    }

    // Don't do any work if this is native
    if (_kind == TCKind._tk_native)
        throw wrapper.cannotMarshalNative() ;

    // We have to remember the stream and position for EVERY type code
    // in case some recursive or indirect type code references it.
    TypeCodeReader topStream = tcis.getTopLevelStream();

    if (_kind == tk_indirect) {
        int streamOffset = tcis.read_long();
        if (streamOffset > -4)
            throw wrapper.invalidIndirection( new Integer(streamOffset) ) ;

        // The encoding used for indirection is the same as that used for recursive ,
        // TypeCodes i.e., a 0xffffffff indirection marker followed by a long offset
        // (in units of octets) from the beginning of the long offset.
        int topPos = tcis.getTopLevelPosition();
        // substract 4 to get back to the beginning of the long offset.
        int indirectTypePosition = topPos - 4 + streamOffset;

        // Now we have to find the referenced type
        // by its indirectTypePosition within topStream.
        //if (debug) System.out.println(
        // "TypeCodeImpl looking up indirection at position topPos " +
        //topPos + " - 4 + offset " + streamOffset + " = " + indirectTypePosition);
        TypeCodeImpl type = topStream.getTypeCodeAtPosition(indirectTypePosition);
        if (type == null)
            throw wrapper.indirectionNotFound( new Integer(indirectTypePosition) ) ;
        setIndirectType(type);
        return false;
    }

    topStream.addTypeCodeAtPosition(this, myPosition);
    return true;
}
 
Example 10
Source File: TypeCodeImpl.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
boolean read_value_kind(TypeCodeReader tcis)
{
    _kind = tcis.read_long();

    // Bug fix 5034649: allow for padding that precedes the typecode kind.
    int myPosition = tcis.getTopLevelPosition()-4;

    // check validity of kind
    if ((_kind < 0 || _kind > typeTable.length) && _kind != tk_indirect) {
        throw wrapper.cannotMarshalBadTckind() ;
    }

    // Don't do any work if this is native
    if (_kind == TCKind._tk_native)
        throw wrapper.cannotMarshalNative() ;

    // We have to remember the stream and position for EVERY type code
    // in case some recursive or indirect type code references it.
    TypeCodeReader topStream = tcis.getTopLevelStream();

    if (_kind == tk_indirect) {
        int streamOffset = tcis.read_long();
        if (streamOffset > -4)
            throw wrapper.invalidIndirection( new Integer(streamOffset) ) ;

        // The encoding used for indirection is the same as that used for recursive ,
        // TypeCodes i.e., a 0xffffffff indirection marker followed by a long offset
        // (in units of octets) from the beginning of the long offset.
        int topPos = tcis.getTopLevelPosition();
        // substract 4 to get back to the beginning of the long offset.
        int indirectTypePosition = topPos - 4 + streamOffset;

        // Now we have to find the referenced type
        // by its indirectTypePosition within topStream.
        //if (debug) System.out.println(
        // "TypeCodeImpl looking up indirection at position topPos " +
        //topPos + " - 4 + offset " + streamOffset + " = " + indirectTypePosition);
        TypeCodeImpl type = topStream.getTypeCodeAtPosition(indirectTypePosition);
        if (type == null)
            throw wrapper.indirectionNotFound( new Integer(indirectTypePosition) ) ;
        setIndirectType(type);
        return false;
    }

    topStream.addTypeCodeAtPosition(this, myPosition);
    return true;
}