Java Code Examples for java.io.ObjectStreamClass#toString()
The following examples show how to use
java.io.ObjectStreamClass#toString() .
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: TestObjectStreamClass.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { ByteArrayOutputStream byteOutput = new ByteArrayOutputStream(); ObjectOutputStream output = new ObjectOutputStream(byteOutput); output.writeObject(new TestClass()); ByteArrayInputStream bais = new ByteArrayInputStream(byteOutput.toByteArray()); TestObjectInputStream input = new TestObjectInputStream(bais); input.readObject(); ObjectStreamClass osc = input.getDescriptor(); // All OSC public API methods should complete without throwing. osc.getName(); osc.forClass(); osc.getField("str"); osc.getFields(); osc.getSerialVersionUID(); osc.toString(); }
Example 2
Source File: TestObjectStreamClass.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { ByteArrayOutputStream byteOutput = new ByteArrayOutputStream(); ObjectOutputStream output = new ObjectOutputStream(byteOutput); output.writeObject(new TestClass()); ByteArrayInputStream bais = new ByteArrayInputStream(byteOutput.toByteArray()); TestObjectInputStream input = new TestObjectInputStream(bais); input.readObject(); ObjectStreamClass osc = input.getDescriptor(); // All OSC public API methods should complete without throwing. osc.getName(); osc.forClass(); osc.getField("str"); osc.getFields(); osc.getSerialVersionUID(); osc.toString(); }
Example 3
Source File: TestObjectStreamClass.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { ByteArrayOutputStream byteOutput = new ByteArrayOutputStream(); ObjectOutputStream output = new ObjectOutputStream(byteOutput); output.writeObject(new TestClass()); ByteArrayInputStream bais = new ByteArrayInputStream(byteOutput.toByteArray()); TestObjectInputStream input = new TestObjectInputStream(bais); input.readObject(); ObjectStreamClass osc = input.getDescriptor(); // All OSC public API methods should complete without throwing. osc.getName(); osc.forClass(); osc.getField("str"); osc.getFields(); osc.getSerialVersionUID(); osc.toString(); }
Example 4
Source File: TestObjectStreamClass.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { ByteArrayOutputStream byteOutput = new ByteArrayOutputStream(); ObjectOutputStream output = new ObjectOutputStream(byteOutput); output.writeObject(new TestClass()); ByteArrayInputStream bais = new ByteArrayInputStream(byteOutput.toByteArray()); TestObjectInputStream input = new TestObjectInputStream(bais); input.readObject(); ObjectStreamClass osc = input.getDescriptor(); // All OSC public API methods should complete without throwing. osc.getName(); osc.forClass(); osc.getField("str"); osc.getFields(); osc.getSerialVersionUID(); osc.toString(); }
Example 5
Source File: TestObjectStreamClass.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { ByteArrayOutputStream byteOutput = new ByteArrayOutputStream(); ObjectOutputStream output = new ObjectOutputStream(byteOutput); output.writeObject(new TestClass()); ByteArrayInputStream bais = new ByteArrayInputStream(byteOutput.toByteArray()); TestObjectInputStream input = new TestObjectInputStream(bais); input.readObject(); ObjectStreamClass osc = input.getDescriptor(); // All OSC public API methods should complete without throwing. osc.getName(); osc.forClass(); osc.getField("str"); osc.getFields(); osc.getSerialVersionUID(); osc.toString(); }
Example 6
Source File: TestObjectStreamClass.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { ByteArrayOutputStream byteOutput = new ByteArrayOutputStream(); ObjectOutputStream output = new ObjectOutputStream(byteOutput); output.writeObject(new TestClass()); ByteArrayInputStream bais = new ByteArrayInputStream(byteOutput.toByteArray()); TestObjectInputStream input = new TestObjectInputStream(bais); input.readObject(); ObjectStreamClass osc = input.getDescriptor(); // All OSC public API methods should complete without throwing. osc.getName(); osc.forClass(); osc.getField("str"); osc.getFields(); osc.getSerialVersionUID(); osc.toString(); }
Example 7
Source File: TestObjectStreamClass.java From hottub with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { ByteArrayOutputStream byteOutput = new ByteArrayOutputStream(); ObjectOutputStream output = new ObjectOutputStream(byteOutput); output.writeObject(new TestClass()); ByteArrayInputStream bais = new ByteArrayInputStream(byteOutput.toByteArray()); TestObjectInputStream input = new TestObjectInputStream(bais); input.readObject(); ObjectStreamClass osc = input.getDescriptor(); // All OSC public API methods should complete without throwing. osc.getName(); osc.forClass(); osc.getField("str"); osc.getFields(); osc.getSerialVersionUID(); osc.toString(); }
Example 8
Source File: TestObjectStreamClass.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { ByteArrayOutputStream byteOutput = new ByteArrayOutputStream(); ObjectOutputStream output = new ObjectOutputStream(byteOutput); output.writeObject(new TestClass()); ByteArrayInputStream bais = new ByteArrayInputStream(byteOutput.toByteArray()); TestObjectInputStream input = new TestObjectInputStream(bais); input.readObject(); ObjectStreamClass osc = input.getDescriptor(); // All OSC public API methods should complete without throwing. osc.getName(); osc.forClass(); osc.getField("str"); osc.getFields(); osc.getSerialVersionUID(); osc.toString(); }
Example 9
Source File: ObjectStreamClassTest.java From j2objc with Apache License 2.0 | 5 votes |
/** * java.io.ObjectStreamClass#toString() */ public void test_toString() { ObjectStreamClass osc = ObjectStreamClass.lookup(DummyClass.class); String oscString = osc.toString(); // The previous test was more specific than the spec so it was replaced // with the test below assertTrue("toString returned incorrect string: " + osc.toString(), oscString.indexOf("serialVersionUID") >= 0 && oscString.indexOf("999999999999999L") >= 0); }