Mark Slee | d602f82 | 2007-11-28 02:45:13 +0000 | [diff] [blame] | 1 | // Copyright (c) 2006- Facebook |
| 2 | // Distributed under the Thrift Software License |
| 3 | // |
| 4 | // See accompanying file LICENSE or visit the Thrift site at: |
| 5 | // http://developers.facebook.com/thrift/ |
| 6 | |
| 7 | package com.facebook.thrift; |
| 8 | |
| 9 | import java.io.ByteArrayOutputStream; |
| 10 | |
| 11 | /** |
| 12 | * Class that allows access to the underlying buf without doing deep |
| 13 | * copies on it. |
| 14 | * |
| 15 | * @author Mark Slee <mcslee@facebook.com> |
| 16 | */ |
| 17 | public class TByteArrayOutputStream extends ByteArrayOutputStream { |
| 18 | public TByteArrayOutputStream(int size) { |
| 19 | super(size); |
| 20 | } |
| 21 | |
| 22 | public byte[] get() { |
| 23 | return buf; |
| 24 | } |
| 25 | |
| 26 | public int len() { |
| 27 | return count; |
| 28 | } |
| 29 | } |