Package java.io

Examples of java.io.DataInputStream.readByte()


        public Object objectFromByteBuffer(byte[] buf) throws Exception {
            if(buf == null)
                return null;

            DataInputStream in=new DataInputStream(new ByteArrayInputStream(buf));
            byte type=in.readByte();
            if(type == NULL)
                return null;
            if(type == METHOD_CALL) {
                short id=in.readShort();
                short length=in.readShort();
View Full Code Here


                    }
                    if(discard_incompatible_packets)
                        return;
                }

                flags=dis.readByte();
                boolean is_message_list=(flags & LIST) == LIST;
                boolean multicast=(flags & MULTICAST) == MULTICAST;

                if(is_message_list) { // used if message bundling is enabled
                    List<Message> msgs=readMessageList(dis);
View Full Code Here

        public static CompressedSegment readFrom(final byte[] in) throws IOException {
            FastByteArrayInputStream bis = new FastByteArrayInputStream(in);
            DataInput dis = new DataInputStream(bis);
            int totalEntries = dis.readInt();
            int bitwidth = dis.readByte();
            int firstException = dis.readInt();
            int len = dis.readInt();
            byte[] b = new byte[len];
            dis.readFully(b, 0, len);
            FastByteArrayInputStream codesIs = new FastByteArrayInputStream(b);
View Full Code Here

                }
                break;
            }
            case 'H': {
                println("CopyOutResponse");
                println(" format: " + dataIn.readByte());
                int columns = dataIn.readShort();
                for (int i = 0; i < columns; i++) {
                    println(" formatCode[" + i + "]: " + dataIn.readShort());
                }
                break;
View Full Code Here

                println(" columns : " + columns);
                for (int i = 0; i < columns; i++) {
                    int l = dataIn.readInt();
                    if (l > 0) {
                        for (int j = 0; j < l; j++) {
                            dataIn.readByte();
                        }
                    }
                    // println(" ["+i+"] len: " + l);
                }
                break;
View Full Code Here

                break;
            }
            case 'E': {
                println("ErrorResponse");
                while (true) {
                    int fieldType = dataIn.readByte();
                    if (fieldType == 0) {
                        break;
                    }
                    String msg = readStringNull(dataIn);
                    // http://developer.postgresql.org/pgdocs/postgres/protocol-error-fields.html
View Full Code Here

                break;
            }
            case 'N': {
                println("NoticeResponse");
                while (true) {
                    int fieldType = dataIn.readByte();
                    if (fieldType == 0) {
                        break;
                    }
                    String msg = readStringNull(dataIn);
                    // http://developer.postgresql.org/pgdocs/postgres/protocol-error-fields.html
View Full Code Here

                println("ParseComplete");
                break;
            }
            case 'Z': {
                println("ReadyForQuery");
                println(" status (I:idle, T:transaction, E:failed): " + (char) dataIn.readByte());
                break;
            }
            case 'T': {
                println("RowDescription");
                int columns = dataIn.readShort();
View Full Code Here

                    println(" message: " + readStringNull(dataIn));
                    break;
                }
                case 'D': {
                    println("Describe");
                    println(" type (S=prepared statement, P=portal): " + (char) dataIn.readByte());
                    println(" name: " + readStringNull(dataIn));
                    break;
                }
                case 'E': {
                    println("Execute");
View Full Code Here

                    for (int i = 0; i < count; i++) {
                        int l = dataIn.readInt();
                        println(" len[" + i + "]: " + l);
                        if (l >= 0) {
                            for (int j = 0; j < l; j++) {
                                dataIn.readByte();
                            }
                        }
                    }
                    println(" resultFormat: " + dataIn.readShort());
                    break;
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.