com.sun.corba.se.impl.encoding.TypeCodeReader Java Examples
The following examples show how to use
com.sun.corba.se.impl.encoding.TypeCodeReader.
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 | 6 votes |
public void read_value(InputStream is) { if (is instanceof TypeCodeReader) { // hardly possible unless caller knows our "private" stream classes. if (read_value_kind((TypeCodeReader)is)) read_value_body(is); } else if (is instanceof CDRInputStream) { WrapperInputStream wrapper = new WrapperInputStream((CDRInputStream)is); //if (debug) System.out.println("Created WrapperInputStream " + wrapper + // " with no parent"); if (read_value_kind((TypeCodeReader)wrapper)) read_value_body(wrapper); } else { read_value_kind(is); read_value_body(is); } }
Example #2
Source File: TypeCodeImpl.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
public void read_value(InputStream is) { if (is instanceof TypeCodeReader) { // hardly possible unless caller knows our "private" stream classes. if (read_value_kind((TypeCodeReader)is)) read_value_body(is); } else if (is instanceof CDRInputStream) { WrapperInputStream wrapper = new WrapperInputStream((CDRInputStream)is); //if (debug) System.out.println("Created WrapperInputStream " + wrapper + // " with no parent"); if (read_value_kind((TypeCodeReader)wrapper)) read_value_body(wrapper); } else { read_value_kind(is); read_value_body(is); } }
Example #3
Source File: TypeCodeImpl.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
public void read_value(InputStream is) { if (is instanceof TypeCodeReader) { // hardly possible unless caller knows our "private" stream classes. if (read_value_kind((TypeCodeReader)is)) read_value_body(is); } else if (is instanceof CDRInputStream) { WrapperInputStream wrapper = new WrapperInputStream((CDRInputStream)is); //if (debug) System.out.println("Created WrapperInputStream " + wrapper + // " with no parent"); if (read_value_kind((TypeCodeReader)wrapper)) read_value_body(wrapper); } else { read_value_kind(is); read_value_body(is); } }
Example #4
Source File: TypeCodeImpl.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
public void read_value(InputStream is) { if (is instanceof TypeCodeReader) { // hardly possible unless caller knows our "private" stream classes. if (read_value_kind((TypeCodeReader)is)) read_value_body(is); } else if (is instanceof CDRInputStream) { WrapperInputStream wrapper = new WrapperInputStream((CDRInputStream)is); //if (debug) System.out.println("Created WrapperInputStream " + wrapper + // " with no parent"); if (read_value_kind((TypeCodeReader)wrapper)) read_value_body(wrapper); } else { read_value_kind(is); read_value_body(is); } }
Example #5
Source File: TypeCodeImpl.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
public void read_value(InputStream is) { if (is instanceof TypeCodeReader) { // hardly possible unless caller knows our "private" stream classes. if (read_value_kind((TypeCodeReader)is)) read_value_body(is); } else if (is instanceof CDRInputStream) { WrapperInputStream wrapper = new WrapperInputStream((CDRInputStream)is); //if (debug) System.out.println("Created WrapperInputStream " + wrapper + // " with no parent"); if (read_value_kind((TypeCodeReader)wrapper)) read_value_body(wrapper); } else { read_value_kind(is); read_value_body(is); } }
Example #6
Source File: TypeCodeImpl.java From JDKSourceCode1.8 with MIT License | 6 votes |
public void read_value(InputStream is) { if (is instanceof TypeCodeReader) { // hardly possible unless caller knows our "private" stream classes. if (read_value_kind((TypeCodeReader)is)) read_value_body(is); } else if (is instanceof CDRInputStream) { WrapperInputStream wrapper = new WrapperInputStream((CDRInputStream)is); //if (debug) System.out.println("Created WrapperInputStream " + wrapper + // " with no parent"); if (read_value_kind((TypeCodeReader)wrapper)) read_value_body(wrapper); } else { read_value_kind(is); read_value_body(is); } }
Example #7
Source File: TypeCodeImpl.java From hottub with GNU General Public License v2.0 | 6 votes |
public void read_value(InputStream is) { if (is instanceof TypeCodeReader) { // hardly possible unless caller knows our "private" stream classes. if (read_value_kind((TypeCodeReader)is)) read_value_body(is); } else if (is instanceof CDRInputStream) { WrapperInputStream wrapper = new WrapperInputStream((CDRInputStream)is); //if (debug) System.out.println("Created WrapperInputStream " + wrapper + // " with no parent"); if (read_value_kind((TypeCodeReader)wrapper)) read_value_body(wrapper); } else { read_value_kind(is); read_value_body(is); } }
Example #8
Source File: TypeCodeImpl.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
public void read_value(InputStream is) { if (is instanceof TypeCodeReader) { // hardly possible unless caller knows our "private" stream classes. if (read_value_kind((TypeCodeReader)is)) read_value_body(is); } else if (is instanceof CDRInputStream) { WrapperInputStream wrapper = new WrapperInputStream((CDRInputStream)is); //if (debug) System.out.println("Created WrapperInputStream " + wrapper + // " with no parent"); if (read_value_kind((TypeCodeReader)wrapper)) read_value_body(wrapper); } else { read_value_kind(is); read_value_body(is); } }
Example #9
Source File: TypeCodeImpl.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
public void read_value(InputStream is) { if (is instanceof TypeCodeReader) { // hardly possible unless caller knows our "private" stream classes. if (read_value_kind((TypeCodeReader)is)) read_value_body(is); } else if (is instanceof CDRInputStream) { WrapperInputStream wrapper = new WrapperInputStream((CDRInputStream)is); //if (debug) System.out.println("Created WrapperInputStream " + wrapper + // " with no parent"); if (read_value_kind((TypeCodeReader)wrapper)) read_value_body(wrapper); } else { read_value_kind(is); read_value_body(is); } }
Example #10
Source File: TypeCodeImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
public void read_value(InputStream is) { if (is instanceof TypeCodeReader) { // hardly possible unless caller knows our "private" stream classes. if (read_value_kind((TypeCodeReader)is)) read_value_body(is); } else if (is instanceof CDRInputStream) { WrapperInputStream wrapper = new WrapperInputStream((CDRInputStream)is); //if (debug) System.out.println("Created WrapperInputStream " + wrapper + // " with no parent"); if (read_value_kind((TypeCodeReader)wrapper)) read_value_body(wrapper); } else { read_value_kind(is); read_value_body(is); } }
Example #11
Source File: TypeCodeImpl.java From jdk1.8-source-analysis with Apache License 2.0 | 5 votes |
private void read_value_recursive(TypeCodeInputStream is) { // don't wrap a CDRInputStream reading "inner" TypeCodes. if (is instanceof TypeCodeReader) { if (read_value_kind((TypeCodeReader)is)) read_value_body(is); } else { read_value_kind((InputStream)is); read_value_body(is); } }
Example #12
Source File: TypeCodeImpl.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
private void read_value_recursive(TypeCodeInputStream is) { // don't wrap a CDRInputStream reading "inner" TypeCodes. if (is instanceof TypeCodeReader) { if (read_value_kind((TypeCodeReader)is)) read_value_body(is); } else { read_value_kind((InputStream)is); read_value_body(is); } }
Example #13
Source File: TypeCodeImpl.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
private void read_value_recursive(TypeCodeInputStream is) { // don't wrap a CDRInputStream reading "inner" TypeCodes. if (is instanceof TypeCodeReader) { if (read_value_kind((TypeCodeReader)is)) read_value_body(is); } else { read_value_kind((InputStream)is); read_value_body(is); } }
Example #14
Source File: TypeCodeImpl.java From hottub with GNU General Public License v2.0 | 5 votes |
private void read_value_recursive(TypeCodeInputStream is) { // don't wrap a CDRInputStream reading "inner" TypeCodes. if (is instanceof TypeCodeReader) { if (read_value_kind((TypeCodeReader)is)) read_value_body(is); } else { read_value_kind((InputStream)is); read_value_body(is); } }
Example #15
Source File: TypeCodeImpl.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
private void read_value_recursive(TypeCodeInputStream is) { // don't wrap a CDRInputStream reading "inner" TypeCodes. if (is instanceof TypeCodeReader) { if (read_value_kind((TypeCodeReader)is)) read_value_body(is); } else { read_value_kind((InputStream)is); read_value_body(is); } }
Example #16
Source File: TypeCodeImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
private void read_value_recursive(TypeCodeInputStream is) { // don't wrap a CDRInputStream reading "inner" TypeCodes. if (is instanceof TypeCodeReader) { if (read_value_kind((TypeCodeReader)is)) read_value_body(is); } else { read_value_kind((InputStream)is); read_value_body(is); } }
Example #17
Source File: TypeCodeImpl.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
private void read_value_recursive(TypeCodeInputStream is) { // don't wrap a CDRInputStream reading "inner" TypeCodes. if (is instanceof TypeCodeReader) { if (read_value_kind((TypeCodeReader)is)) read_value_body(is); } else { read_value_kind((InputStream)is); read_value_body(is); } }
Example #18
Source File: TypeCodeImpl.java From JDKSourceCode1.8 with MIT License | 5 votes |
private void read_value_recursive(TypeCodeInputStream is) { // don't wrap a CDRInputStream reading "inner" TypeCodes. if (is instanceof TypeCodeReader) { if (read_value_kind((TypeCodeReader)is)) read_value_body(is); } else { read_value_kind((InputStream)is); read_value_body(is); } }
Example #19
Source File: TypeCodeImpl.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
private void read_value_recursive(TypeCodeInputStream is) { // don't wrap a CDRInputStream reading "inner" TypeCodes. if (is instanceof TypeCodeReader) { if (read_value_kind((TypeCodeReader)is)) read_value_body(is); } else { read_value_kind((InputStream)is); read_value_body(is); } }
Example #20
Source File: TypeCodeImpl.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
private void read_value_recursive(TypeCodeInputStream is) { // don't wrap a CDRInputStream reading "inner" TypeCodes. if (is instanceof TypeCodeReader) { if (read_value_kind((TypeCodeReader)is)) read_value_body(is); } else { read_value_kind((InputStream)is); read_value_body(is); } }
Example #21
Source File: TypeCodeImpl.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
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 #22
Source File: TypeCodeImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
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 #23
Source File: TypeCodeImpl.java From JDKSourceCode1.8 with MIT License | 4 votes |
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 #24
Source File: TypeCodeImpl.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
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 #25
Source File: TypeCodeImpl.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
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 #26
Source File: TypeCodeImpl.java From hottub with GNU General Public License v2.0 | 4 votes |
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 #27
Source File: TypeCodeImpl.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
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 #28
Source File: TypeCodeImpl.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
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 #29
Source File: TypeCodeImpl.java From jdk1.8-source-analysis with Apache License 2.0 | 4 votes |
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 #30
Source File: TypeCodeImpl.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
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; }