|
11 | 11 | __all__ = [ |
12 | 12 | "BufferedReader", |
13 | 13 | "BufferedWriter", |
| 14 | + "ByteArrayInputStream", |
| 15 | + "ByteArrayOutputStream", |
14 | 16 | "Closeable", |
15 | 17 | "DataOutputStream", |
16 | 18 | "File", |
@@ -96,6 +98,29 @@ def write(self, *args): |
96 | 98 | pass |
97 | 99 |
|
98 | 100 |
|
| 101 | +class ByteArrayOutputStream(OutputStream): |
| 102 | + def __init__(self, size=0): |
| 103 | + # type: (int) -> None |
| 104 | + super(ByteArrayOutputStream, self).__init__() |
| 105 | + print(size) |
| 106 | + |
| 107 | + def reset(self): |
| 108 | + # type: () -> None |
| 109 | + pass |
| 110 | + |
| 111 | + def size(self): |
| 112 | + # type: () -> int |
| 113 | + pass |
| 114 | + |
| 115 | + def toByteArray(self): |
| 116 | + # type: () -> bytearray |
| 117 | + pass |
| 118 | + |
| 119 | + def writeTo(self, arg): |
| 120 | + # type: (Union[bytearray, OutputStream]) -> None |
| 121 | + pass |
| 122 | + |
| 123 | + |
99 | 124 | class FileOutputStream(OutputStream): |
100 | 125 | def __init__(self, *args): |
101 | 126 | # type: (*Any) -> None |
@@ -257,6 +282,13 @@ def transferTo(self, out): |
257 | 282 | pass |
258 | 283 |
|
259 | 284 |
|
| 285 | +class ByteArrayInputStream(InputStream): |
| 286 | + def __init__(self, buf, offset=0, length=-1): |
| 287 | + # type: (bytearray, int, int) -> None |
| 288 | + super(ByteArrayInputStream, self).__init__() |
| 289 | + print(buf, offset, length) |
| 290 | + |
| 291 | + |
260 | 292 | class IOException(Exception): |
261 | 293 | def __init__(self, message=None, cause=None): |
262 | 294 | # type: (Optional[str], Optional[Throwable]) -> None |
|
0 commit comments