Package org.apache.mina.core.buffer

Examples of org.apache.mina.core.buffer.IoBuffer.array()


      buffer.put(this.convertIntToByteArray(clientFrameBean.getHeight()));//4 Byte
      buffer.put(this.convertIntToByteArray(lengthPayload));//4 Byte
      buffer.put(securityTokenAsByte);//32 Byte usually
      buffer.put(clientFrameBean.getImageBytes());
     
      log.debug("FRAME SIZE "+ClientCaptureScreen.frameCalculated+"||"+frameSize+"||"+buffer.array().length);
 
  //        IoBuffer buffer = IoBuffer.allocate(12, false);
  //
  //        buffer.putInt(request.getWidth());
  //
View Full Code Here


                continue;
            }

            int writtenBytes = buf.remaining();
            try {
                outputStream.write(buf.array(), buf.position(), writtenBytes);
                buf.position(buf.position() + writtenBytes);
               
                // increase written bytes
                increaseWrittenBytes(writtenBytes, System.currentTimeMillis());
               
View Full Code Here

                    + objectSize + " (expected: <= " + maxObjectSize + ')');
        }

        IoBuffer buf = IoBuffer.allocate(objectSize + 4, false);
        buf.putInt(objectSize);
        in.readFully(buf.array(), 4, objectSize);
        buf.position(0);
        buf.limit(objectSize + 4);

        return buf.getObject(classLoader);
    }
View Full Code Here

            throw new IllegalArgumentException(
                    "The encoded object is too big: " + objectSize + " (> "
                            + maxObjectSize + ')');
        }

        out.write(buf.array(), 0, buf.position());
    }

    public void writeBoolean(boolean v) throws IOException {
        out.writeBoolean(v);
    }
View Full Code Here

    }

    private String toString(ByteArray ba) {
        IoBuffer bb = IoBuffer.allocate(ba.length());
        ba.get(0, bb);
        byte[] bytes = bb.array();
        String string = new String(bytes);
        return string;
    }

    public void testCompositeStringJoin() throws Exception {
View Full Code Here

                continue;
            }

            int writtenBytes = buf.remaining();
            try {
                outputStream.write(buf.array());
                buf.position(buf.position() + writtenBytes);
            } catch (IOException e) {
                this.getFilterChain().fireExceptionCaught(e);
            }
        }
View Full Code Here

                continue;
            }

            int writtenBytes = buf.remaining();
            try {
                outputStream.write(buf.array(), buf.position(), writtenBytes);
                buf.position(buf.position() + writtenBytes);
               
                // increase written bytes
                increaseWrittenBytes(writtenBytes, System.currentTimeMillis());
               
View Full Code Here

                    + objectSize + " (expected: <= " + maxObjectSize + ')');
        }

        IoBuffer buf = IoBuffer.allocate(objectSize + 4, false);
        buf.putInt(objectSize);
        in.readFully(buf.array(), 4, objectSize);
        buf.position(0);
        buf.limit(objectSize + 4);

        return buf.getObject(classLoader);
    }
View Full Code Here

            throw new IllegalArgumentException(
                    "The encoded object is too big: " + objectSize + " (> "
                            + maxObjectSize + ')');
        }

        out.write(buf.array(), 0, buf.position());
    }

    public void writeBoolean(boolean v) throws IOException {
        out.writeBoolean(v);
    }
View Full Code Here

    }

    private String toString(ByteArray ba) {
        IoBuffer bb = IoBuffer.allocate(ba.length());
        ba.get(0, bb);
        byte[] bytes = bb.array();
        String string = new String(bytes);
        return string;
    }

    public void testCompositeStringJoin() throws Exception {
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.