Package org.jboss.marshalling

Examples of org.jboss.marshalling.ByteInput


         marshaller.finish();
      }
     
      byte[] bytes = baos.toByteArray();
     
      ByteInput byteInput = Marshalling.createByteInput(new ByteArrayInputStream(bytes));
      unmarshaller.start(byteInput);
      try {
         assert obj.equals(unmarshaller.readObject());
      } finally {
         unmarshaller.finish();
View Full Code Here


        byteOutput.flush();

        final byte[] chunked = byteArrayOutputStream.toByteArray();

        final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(chunked);
        final ByteInput byteInput = new ChunkyByteInput(Marshalling.createByteInput(byteArrayInputStream));

        int readLength = 5;
        byte[] result = new byte[content.length];
        byteInput.read(result, content.length - 6, readLength);
        byteInput.close();

        byte[] expected = new byte[content.length];
        System.arraycopy(content, 0, expected, content.length - 6, readLength);

        Assert.assertArrayEquals(expected, result);
        Assert.assertEquals(-1, byteInput.read());
    }
View Full Code Here

            @Override
            public int read(final byte[] b) throws IOException {
                return dataInput.read(b);
            }
        };
        final ByteInput byteInput = Marshalling.createByteInput(is);
        // start the unmarshaller
        unmarshaller.start(byteInput);

        return unmarshaller;
    }
View Full Code Here

        byteOutput.flush();

        final byte[] chunked = byteArrayOutputStream.toByteArray();

        final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(chunked);
        final ByteInput byteInput = new ChunkyByteInput(Marshalling.createByteInput(byteArrayInputStream));
        byte[] result = new byte[content.length];
        byteInput.read(result);
        byteInput.close();

        Assert.assertArrayEquals(content, result);
        Assert.assertEquals(-1, byteInput.read());
    }
View Full Code Here

        byteOutput.flush();

        final byte[] chunked = byteArrayOutputStream.toByteArray();

        final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(chunked);
        final ByteInput byteInput = new ChunkyByteInput(Marshalling.createByteInput(byteArrayInputStream));
        byte[] result = new byte[content.length];
        byteInput.read(result);
        byteInput.close();

        Assert.assertArrayEquals(content, result);
        Assert.assertEquals(-1, byteInput.read());
    }
View Full Code Here

        byteOutput.flush();

        final byte[] chunked = byteArrayOutputStream.toByteArray();

        final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(chunked);
        final ByteInput byteInput = new ChunkyByteInput(Marshalling.createByteInput(byteArrayInputStream));
        byte[] result = new byte[content.length];
        byteInput.read(result);
        byteInput.close();

        Assert.assertArrayEquals(content, result);
        Assert.assertEquals(-1, byteInput.read());
    }
View Full Code Here

        byteOutput.flush();

        final byte[] chunked = byteArrayOutputStream.toByteArray();

        final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(chunked);
        final ByteInput byteInput = new ChunkyByteInput(Marshalling.createByteInput(byteArrayInputStream));
        int readLength = content.length - 15;
        byte[] result = new byte[readLength];
        byteInput.read(result);
        byteInput.close();

        byte[] expected = new byte[readLength];
        System.arraycopy(content, 0, expected, 0, readLength);

        Assert.assertArrayEquals(expected, result);
        Assert.assertEquals(-1, byteInput.read());
    }
View Full Code Here

        StepObjectInput(final Queue<Step> steps) throws IOException {
            super(bufferSize);
            this.steps = steps;
            current = steps.poll();
            super.start(new ByteInput() {

                public int read() throws IOException {
                    while (current != null) {
                        if (current instanceof ByteDataStep) {
                            final ByteDataStep step = (ByteDataStep) current;
View Full Code Here

            factory = Marshalling.getMarshallerFactory("river", Module.getModuleFromDefaultLoader(ModuleIdentifier.fromString("org.jboss.marshalling.river")).getClassLoader());
        } catch (ModuleLoadException e) {
            throw new IllegalStateException("Failed to start server", e);
        }
        final Unmarshaller unmarshaller;
        final ByteInput byteInput;
        try {
            final MarshallingConfiguration configuration = new MarshallingConfiguration();
            configuration.setVersion(2);
            configuration.setClassTable(ModularClassTable.getInstance());
            unmarshaller = factory.createUnmarshaller(configuration);
View Full Code Here

                    } catch (EOFException eof) {
                        return -1;
                    }
                }
            };
            final ByteInput byteInput = Marshalling.createByteInput(is);
            this.delegate.start(byteInput);
        }
View Full Code Here

TOP

Related Classes of org.jboss.marshalling.ByteInput

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.