home *** CD-ROM | disk | FTP | other *** search
- package sitemap;
-
- import java.io.IOException;
- import java.io.InputStream;
-
- public class MyBufferedInputStream {
- InputStream m_is;
- byte[] m_buffer = new byte[16384];
- int m_nBufferCount = 0;
- int m_nBytesRead = 0;
-
- private void RefreshBuffer() {
- try {
- this.m_nBytesRead = this.m_is.read(this.m_buffer);
- this.m_nBufferCount = this.m_nBytesRead;
- } catch (IOException var2) {
- ((Throwable)var2).printStackTrace();
- this.m_nBytesRead = 0;
- this.m_nBufferCount = -1;
- }
- }
-
- public void close() throws IOException {
- this.m_is.close();
- }
-
- public MyBufferedInputStream(InputStream var1) {
- this.m_is = var1;
- }
-
- public int read() throws IOException {
- if (this.m_nBufferCount == 0) {
- this.RefreshBuffer();
- }
-
- if (this.m_nBufferCount < 0) {
- return -1;
- } else {
- this.m_nBufferCount += -1;
- return this.m_buffer[this.m_nBytesRead - (this.m_nBufferCount + 1)] < 0 ? this.m_buffer[this.m_nBytesRead - (this.m_nBufferCount + 1)] + 256 : this.m_buffer[this.m_nBytesRead - (this.m_nBufferCount + 1)];
- }
- }
- }
-