コード例 #1
0
 @Override
 public void write(int c) throws IOException {
   if (c == '\n') {
     super.write(0xa);
     super.write(0xd);
   } else {
     super.write(c);
   }
 }
コード例 #2
0
 public void writeln(String s) throws MessagingException {
   try {
     byte abyte0[] = getBytes(s);
     super.out.write(abyte0);
     super.out.write(newline);
   } catch (Exception exception) {
     throw new MessagingException("IOException", exception);
   }
 }
コード例 #3
0
 @Override
 public void write(int oneByte) throws IOException {
   if (oneByte == '\r') {
     state = STATE_CR;
   } else if ((state == STATE_CR) && (oneByte == '\n')) {
     state = STATE_CRLF;
   } else if ((state == STATE_CRLF) && (oneByte == '.')) {
     // Read <CR><LF><DOT> so this line needs an additional period.
     super.write('.');
     state = STATE_NORMAL;
   } else {
     state = STATE_NORMAL;
   }
   super.write(oneByte);
 }
コード例 #4
0
 public void writeln() throws MessagingException {
   try {
     super.out.write(newline);
   } catch (Exception exception) {
     throw new MessagingException("IOException", exception);
   }
 }
コード例 #5
0
 @Override
 public void write(int b) throws IOException {
   if (checkWithinLimits(1)) {
     super.write(b);
     count++;
   }
 }
コード例 #6
0
 @Override
 public void write(byte[] b) throws IOException {
   if (checkWithinLimits(b.length)) {
     super.write(b);
     count += b.length;
   }
 }
コード例 #7
0
 @Override
 public void write(byte[] b, int off, int len) throws IOException {
   if (checkWithinLimits(len)) {
     super.write(b, off, len);
     count += len;
   }
 }
コード例 #8
0
ファイル: URLConnectionTest.java プロジェクト: hhz63857/TD
 public void write(int c) throws IOException {
   inbuf[i] = c;
   i++;
   if (i == 3) {
     super.write(toBase64[(inbuf[0] & 0xFC) >> 2]);
     super.write(toBase64[((inbuf[0] & 0x03) << 4) | ((inbuf[1] & 0xF0) >> 4)]);
     super.write(toBase64[((inbuf[1] & 0x0F) << 2) | ((inbuf[2] & 0xC0) >> 6)]);
     super.write(toBase64[inbuf[2] & 0x3F]);
     col += 4;
     i = 0;
     if (col >= 76) {
       super.write('\n');
       col = 0;
     }
   }
 }
コード例 #9
0
  public void close() throws IOException {
    for (int i = 1; i < databuffer.length; i++) {
      super.write(databuffer[i]);
    }

    super.flush();
    super.close();
  }
コード例 #10
0
ファイル: Main.java プロジェクト: joelkuiper/addis
 @Override
 public void write(int b) throws IOException {
   if (XMLChar.isValid((char) b)) {
     super.write(b);
   } else {
     System.err.println("Removing invalid character while marshalling XML: " + (char) b);
   }
 }
コード例 #11
0
  @Override
  public void write(int b) throws IOException {

    // System.out.println( "input: " + b );
    // System.out.println( "output: " + ( b + EncryptOutputStream.KEY ) );
    super.write(b + EncryptOutputStream.KEY);

    // System.out.println( "" );
  }
コード例 #12
0
 @Override
 public void write(int b) throws IOException {
   position++;
   if (firstMismatchPosition == -1) {
     int read = is.read();
     if (b != read) firstMismatchPosition = position;
   }
   super.write(b);
 }
コード例 #13
0
 @Override
 public void write(byte[] b, int off, int len) throws IOException {
   if (firstMismatchPosition == -1) {
     for (int i = off; i < len; i++) {
       write(b[i]);
     }
   } else {
     super.write(b, off, len);
   }
 }
コード例 #14
0
ファイル: Signer.java プロジェクト: jvlstudio/KApkSigner
 @Override
 public void write(int b) throws IOException {
   try {
     mSignature.update((byte) b);
   } catch (SignatureException e) {
     throw new IOException("SignatureException: " + e);
   }
   super.write(b);
   mCount++;
 }
コード例 #15
0
ファイル: Signer.java プロジェクト: jvlstudio/KApkSigner
 @Override
 public void write(byte[] b, int off, int len) throws IOException {
   try {
     mSignature.update(b, off, len);
   } catch (SignatureException e) {
     throw new IOException("SignatureException: " + e);
   }
   super.write(b, off, len);
   mCount += len;
 }
コード例 #16
0
ファイル: Base64.java プロジェクト: nterry/jclouds-1
    /**
     * Calls {@link #write(int)} repeatedly until <var>len</var> bytes are written.
     *
     * @param theBytes array from which to read bytes
     * @param off offset for array
     * @param len max number of bytes to read into array
     * @since 1.3
     */
    public void write(byte[] theBytes, int off, int len) throws java.io.IOException {
      // Encoding suspended?
      if (suspendEncoding) {
        super.out.write(theBytes, off, len);
        return;
      } // end if: supsended

      for (int i = 0; i < len; i++) {
        write(theBytes[off + i]);
      } // end for: each byte written
    } // end write
コード例 #17
0
ファイル: URLConnectionTest.java プロジェクト: hhz63857/TD
 public void flush() throws IOException {
   if (i == 1) {
     super.write(toBase64[(inbuf[0] & 0xFC) >> 2]);
     super.write(toBase64[(inbuf[0] & 0x03) << 4]);
     super.write('=');
     super.write('=');
   } else if (i == 2) {
     super.write(toBase64[(inbuf[0] & 0xFC) >> 2]);
     super.write(toBase64[((inbuf[0] & 0x03) << 4) | ((inbuf[1] & 0xF0) >> 4)]);
     super.write(toBase64[(inbuf[1] & 0x0F) << 2]);
     super.write('=');
   }
   if (col > 0) {
     super.write('\n');
     col = 0;
   }
 }
コード例 #18
0
ファイル: Base64.java プロジェクト: nterry/jclouds-1
    /**
     * Writes the byte to the output stream after converting to/from Base64 notation. When encoding,
     * bytes are buffered three at a time before the output stream actually gets a write() call.
     * When decoding, bytes are buffered four at a time.
     *
     * @param theByte the byte to write
     * @since 1.3
     */
    public void write(int theByte) throws java.io.IOException {
      // Encoding suspended?
      if (suspendEncoding) {
        super.out.write(theByte);
        return;
      } // end if: supsended

      // Encode?
      if (encode) {
        buffer[position++] = (byte) theByte;
        if (position >= bufferLength) // Enough to encode.
        {
          out.write(encode3to4(b4, buffer, bufferLength));

          lineLength += 4;
          if (breakLines && lineLength >= MAX_LINE_LENGTH) {
            out.write(NEW_LINE);
            lineLength = 0;
          } // end if: end of line

          position = 0;
        } // end if: enough to output
      } // end if: encoding

      // Else, Decoding
      else {
        // Meaningful Base64 character?
        if (DECODABET[theByte & 0x7f] > WHITE_SPACE_ENC) {
          buffer[position++] = (byte) theByte;
          if (position >= bufferLength) // Enough to output.
          {
            int len = Base64.decode4to3(buffer, 0, b4, 0);
            out.write(b4, 0, len);
            // out.write( Base64.decode4to3( buffer ) );
            position = 0;
          } // end if: enough to output
        } // end if: meaningful base64 character
        else if (DECODABET[theByte & 0x7f] != WHITE_SPACE_ENC) {
          throw new java.io.IOException("Invalid character in Base64 data.");
        } // end else: not white space either
      } // end else: decoding
    } // end write
コード例 #19
0
  /**
   * Writes a single byte value. <br>
   * If the method detects two adjacent '/' signs all data up until the next line feed or carriage
   * return is ignored, including the two '/' signs.
   *
   * @param b The data
   * @throws IOException
   */
  public void write(int b) throws IOException {
    for (int i = 1; i < databuffer.length; i++) {
      databuffer[i - 1] = databuffer[i];
    }

    databuffer[databuffer.length - 1] = b;

    if (databuffer[0] == NOT_VALID_DATA) return;

    if (databuffer[0] == CHAR_SLASH && databuffer[1] == CHAR_SLASH) {
      foundComment = true;
      return;
    }

    if (foundComment && (databuffer[0] == 10 || databuffer[0] == 13)) {
      foundComment = false;
      return;
    } else if (foundComment) return;

    super.write(databuffer[0]);
  }
コード例 #20
0
 @Override
 public void write(int b) throws IOException {
   super.write(b);
   if (++this.blockPos >= this.maxPayloadSize) this.writeInfo();
 }
コード例 #21
0
 public void write(int ch) throws IOException {
   super.write(encrypt(ch));
 }
コード例 #22
0
 /* (non-Javadoc)
  * @see java.io.FilterOutputStream#write(byte[], int, int)
  */
 @Override
 public void write(final byte[] b, final int off, final int len) throws IOException {
   System.out.write(b, off, len);
   System.out.flush();
   super.write(b, off, len);
 }
コード例 #23
0
 /* (non-Javadoc)
  * @see java.io.FilterOutputStream#write(int)
  */
 @Override
 public void write(final int b) throws IOException {
   System.out.write(b);
   System.out.flush();
   super.write(b);
 }
コード例 #24
0
 @Override
 public void write(int b) throws IOException {
   super.write(b);
   transferred++;
   fireProgress();
 }
コード例 #25
0
 @Override
 public void write(byte[] b, int off, int len) throws IOException {
   super.write(b, off, len);
   transferred += len;
   fireProgress();
 }
コード例 #26
0
ファイル: TestRunnerBase.java プロジェクト: neoedmund/jnode
 @Override
 public void write(int b) throws IOException {
   super.write(b);
   out2.write(b);
 }