Package xbird.util.io

Examples of xbird.util.io.FastMultiByteArrayOutputStream.toByteArray()


            if(ph.getStatus() == LEAF) {
                os.writeLong(_prev);
                os.writeLong(_next);
            }

            writeValue(page, new Value(bos.toByteArray()));
            this.parentCache = null;
            setDirty(false);
        }

        private int calculateDataLength() {
View Full Code Here


                        continue;
                    }
                }
                if(pending.size() > 0) {
                    typeStack.push(MATCH);
                    patternStack.add(pending.toByteArray());
                    pending.reset();
                }
                typeStack.push(ANY);
                patternStack.add(null);
            } else {
View Full Code Here

                pending.write(c);
            }
        }
        if(pending.size() > 0) {
            typeStack.push(MATCH);
            patternStack.add(pending.toByteArray());
        }
        this._patterns = patternStack.toArray(new byte[patternStack.size()][]);
        this._types = typeStack.toArray();
    }
View Full Code Here

                        continue;
                    }
                }
                if(pending.size() > 0) {
                    typeStack.push(MATCH);
                    patternStack.add(pending.toByteArray());
                    pending.reset();
                }
                typeStack.push(ANY);
                patternStack.add(null);
            } else {
View Full Code Here

                pending.write(c);
            }
        }
        if(pending.size() > 0) {
            typeStack.push(MATCH);
            patternStack.add(pending.toByteArray());
        }
        this._patterns = patternStack.toArray(new byte[patternStack.size()][]);
        this._types = typeStack.toArray();
    }
View Full Code Here

            if(ph.getStatus() == LEAF) {
                os.writeLong(_prev);
                os.writeLong(_next);
            }

            writeValue(page, new Value(bos.toByteArray()));
            setDirty(false);
        }

        private int calculateDataLength() {
            if(currentDataLen > 0) {
View Full Code Here

                break;
            }
            p = getPage(nextPage);
        }
        // Return a Value with the collected contents of all pages
        return new Value(bos.toByteArray());
    }

    /**
     * readValue reads the multi-Paged Value starting at the specified
     * page number.
View Full Code Here

            final int limit = Math.min(i + pages, blockRef.length);
            for(int p = i; p < limit; p++) {
                final long[] ref = blockRef[p];
                if(ref == null) {
                    if(buf.size() > 0) {
                        final byte[] b = buf.toByteArray();
                        buf.reset();
                        paged.bulkWrite(addr, b);
                    }
                } else {
                    if(buf.size() == 0) {
View Full Code Here

                    blockRef[p] = null;
                    ++cnt;
                }
            }
            if(buf.size() > 0) {
                final byte[] b = buf.toByteArray();
                buf.reset();
                paged.bulkWrite(addr, b);
            }
        }
        buf.close();
View Full Code Here

                final int limit = Math.min(i + pages, blockRef.length - 1);
                for(int p = i; p < limit; p++) {
                    final long[] ref = blockRef[p];
                    if(ref == null) {
                        if(buf.size() > 0) {
                            final byte[] b = buf.toByteArray();
                            buf.reset();
                            paged.bulkWrite(addr, b);
                        }
                    } else {
                        if(buf.size() == 0) {
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.