public ByteBuffer encode()

in src/main/java/com/twitter/whiskey/net/SpdyHeaderBlockZlibEncoder.java [71:87]


    public ByteBuffer encode(Headers headers) throws Exception {
        if (headers == null) {
            throw new IllegalArgumentException("headers");
        }

        if (finished) {
            throw new RuntimeException("invalid compressor state");
        }

        ByteBuffer uncompressed = super.encode(headers);
        if (!uncompressed.hasRemaining()) {
            return ByteBuffer.allocate(0);
        }

        int len = setInput(uncompressed);
        return encode(len);
    }