Package org.vertx.java.core.buffer

Examples of org.vertx.java.core.buffer.Buffer.appendBytes()


        @Override
        public void write(byte[] b, int off, int len) throws IOException {
            checkState();
            Buffer buffer = new Buffer();
            if (off == 0 && len == b.length) {
                buffer.appendBytes(b);
            } else {
                buffer.appendBytes(Arrays.copyOfRange(b, off, off + len));
            }
            response.write(buffer);
        }
View Full Code Here


            checkState();
            Buffer buffer = new Buffer();
            if (off == 0 && len == b.length) {
                buffer.appendBytes(b);
            } else {
                buffer.appendBytes(Arrays.copyOfRange(b, off, off + len));
            }
            response.write(buffer);
        }

        @Override
View Full Code Here

        @Override
        public void write(final byte[] b, final int off, final int len) throws IOException {
            checkState();
            final Buffer buffer = new Buffer();
            if (off == 0 && len == b.length) {
                buffer.appendBytes(b);
            } else {
                buffer.appendBytes(Arrays.copyOfRange(b, off, off + len));
            }
            response.write(buffer);
        }
View Full Code Here

            checkState();
            final Buffer buffer = new Buffer();
            if (off == 0 && len == b.length) {
                buffer.appendBytes(b);
            } else {
                buffer.appendBytes(Arrays.copyOfRange(b, off, off + len));
            }
            response.write(buffer);
        }

        @Override
View Full Code Here

            try (InputStream in = clazz.getResourceAsStream(resource)) {
                int read;
                byte[] data = new byte[4096];
                while ((read = in.read(data, 0, data.length)) != -1) {
                    if (read == data.length) {
                        buffer.appendBytes(data);
                    } else {
                        byte[] slice = new byte[read];
                        System.arraycopy(data, 0, slice, 0, slice.length);
                        buffer.appendBytes(slice);
                    }
View Full Code Here

                    if (read == data.length) {
                        buffer.appendBytes(data);
                    } else {
                        byte[] slice = new byte[read];
                        System.arraycopy(data, 0, slice, 0, slice.length);
                        buffer.appendBytes(slice);
                    }
                }
            }

            return buffer;
View Full Code Here

                buffer.setValue(new Buffer());

            } else {
                // Will have some remainder to keep in buffer
                int len = fileInfo.getChunkSize() - buffer.getValue().length();
                chunk.appendBytes(data.getBytes(0, len));

                // Add additional chunk to a new buffer
                Buffer remaining = new Buffer();
                remaining.appendBytes(data.getBytes(len, data.length()));
View Full Code Here

                int len = fileInfo.getChunkSize() - buffer.getValue().length();
                chunk.appendBytes(data.getBytes(0, len));

                // Add additional chunk to a new buffer
                Buffer remaining = new Buffer();
                remaining.appendBytes(data.getBytes(len, data.length()));

                buffer.setValue(remaining);
            }

            ChunkInfo chunkInfo = new DefaultChunkInfo()
View Full Code Here

        @Override
        public void write(byte[] b, int off, int len) throws IOException {
            checkState();
            Buffer buffer = new Buffer();
            if (off == 0 && len == b.length) {
                buffer.appendBytes(b);
            } else {
                buffer.appendBytes(Arrays.copyOfRange(b, off, off + len));
            }
            response.write(buffer);
        }
View Full Code Here

            checkState();
            Buffer buffer = new Buffer();
            if (off == 0 && len == b.length) {
                buffer.appendBytes(b);
            } else {
                buffer.appendBytes(Arrays.copyOfRange(b, off, off + len));
            }
            response.write(buffer);
        }

        @Override
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.