public String read_wstring() { // Don't allow transmission of wchar/wstring data with foreign ORBs since it's against the spec. if (ORBUtility.isForeignORB(orb)) { throw wrapper.wcharDataInGiop10(CompletionStatus.COMPLETED_MAYBE); } int len = read_long(); // Workaround for ORBs which send string lengths of zero to mean empty string. // // IMPORTANT: Do not replace 'new String("")' with "", it may result in a Serialization bug (See // serialization.zerolengthstring) and bug id: 4728756 for details if (len == 0) return new String(""); checkForNegativeLength(len); len--; char[] c = new char[len]; for (int i = 0; i < len; i++) c[i] = read_wchar(); // skip the two null terminator bytes read_wchar(); // bbwi.position(bbwi.position() + 2); return new String(c); }
public String read_wstring() { // Don't allow transmission of wchar/wstring data with foreign ORBs since it's against the spec. if (ORBUtility.isForeignORB(orb)) { throw wrapper.wcharDataInGiop10(CompletionStatus.COMPLETED_MAYBE); } int len = read_long(); // Workaround for ORBs which send string lengths of zero to mean empty string. // // IMPORTANT: Do not replace 'new String("")' with "", it may result in a Serialization bug (See // serialization.zerolengthstring) and bug id: 4728756 for details if (len == 0) return new String(""); checkForNegativeLength(len); len--; char[] c = new char[len]; for (int i = 0; i < len; i++) c[i] = read_wchar(); // skip the two null terminator bytes read_wchar(); // bbwi.position(bbwi.position() + 2); return new String(c); }
public void write_wchar(char x) { // Don't allow transmission of wchar/wstring data with foreign ORBs since it's against the spec. if (ORBUtility.isForeignORB(orb)) { throw wrapper.wcharDataInGiop10(CompletionStatus.COMPLETED_MAYBE); } // If it's one of our legacy ORBs, do what they did: alignAndReserve(2, 2); if (littleEndian) { writeLittleEndianWchar(x); } else { writeBigEndianWchar(x); } }
public void write_wchar(char x) { // Don't allow transmission of wchar/wstring data with foreign ORBs since it's against the spec. if (ORBUtility.isForeignORB(orb)) { throw wrapper.wcharDataInGiop10(CompletionStatus.COMPLETED_MAYBE); } // If it's one of our legacy ORBs, do what they did: alignAndReserve(2, 2); if (littleEndian) { writeLittleEndianWchar(x); } else { writeBigEndianWchar(x); } }
public void write_wstring(String value) { if (value == null) throw wrapper.nullParam(CompletionStatus.COMPLETED_MAYBE); // Don't allow transmission of wchar/wstring data with foreign ORBs since it's against the spec. if (ORBUtility.isForeignORB(orb)) { throw wrapper.wcharDataInGiop10(CompletionStatus.COMPLETED_MAYBE); } // When talking to our legacy ORBs, do what they did: int len = value.length() + 1; // This will only have an effect if we're already chunking handleSpecialChunkBegin(4 + (len * 2) + computeAlignment(4)); write_long(len); for (int i = 0; i < len - 1; i++) write_wchar(value.charAt(i)); // Write the null ending write_short((short) 0); // This will only have an effect if we're already chunking handleSpecialChunkEnd(); }
public void write_wstring(String value) { if (value == null) throw wrapper.nullParam(CompletionStatus.COMPLETED_MAYBE); // Don't allow transmission of wchar/wstring data with foreign ORBs since it's against the spec. if (ORBUtility.isForeignORB(orb)) { throw wrapper.wcharDataInGiop10(CompletionStatus.COMPLETED_MAYBE); } // When talking to our legacy ORBs, do what they did: int len = value.length() + 1; // This will only have an effect if we're already chunking handleSpecialChunkBegin(4 + (len * 2) + computeAlignment(4)); write_long(len); for (int i = 0; i < len - 1; i++) write_wchar(value.charAt(i)); // Write the null ending write_short((short) 0); // This will only have an effect if we're already chunking handleSpecialChunkEnd(); }
public char read_wchar() { // Don't allow transmission of wchar/wstring data with foreign ORBs since it's against the spec. if (ORBUtility.isForeignORB(orb)) { throw wrapper.wcharDataInGiop10(CompletionStatus.COMPLETED_MAYBE); } // If we're talking to one of our legacy ORBs, do what they did: int b1, b2; alignAndCheck(2, 2); if (littleEndian) { b2 = bbwi.byteBuffer.get(bbwi.position()) & 0x00FF; bbwi.position(bbwi.position() + 1); b1 = bbwi.byteBuffer.get(bbwi.position()) & 0x00FF; bbwi.position(bbwi.position() + 1); } else { b1 = bbwi.byteBuffer.get(bbwi.position()) & 0x00FF; bbwi.position(bbwi.position() + 1); b2 = bbwi.byteBuffer.get(bbwi.position()) & 0x00FF; bbwi.position(bbwi.position() + 1); } return (char) ((b1 << 8) + (b2 << 0)); }
public char read_wchar() { // Don't allow transmission of wchar/wstring data with foreign ORBs since it's against the spec. if (ORBUtility.isForeignORB(orb)) { throw wrapper.wcharDataInGiop10(CompletionStatus.COMPLETED_MAYBE); } // If we're talking to one of our legacy ORBs, do what they did: int b1, b2; alignAndCheck(2, 2); if (littleEndian) { b2 = bbwi.byteBuffer.get(bbwi.position()) & 0x00FF; bbwi.position(bbwi.position() + 1); b1 = bbwi.byteBuffer.get(bbwi.position()) & 0x00FF; bbwi.position(bbwi.position() + 1); } else { b1 = bbwi.byteBuffer.get(bbwi.position()) & 0x00FF; bbwi.position(bbwi.position() + 1); b2 = bbwi.byteBuffer.get(bbwi.position()) & 0x00FF; bbwi.position(bbwi.position() + 1); } return (char) ((b1 << 8) + (b2 << 0)); }