code: public void encode(InputStream inStream, OutputStream outStream)
          throws IOException {
          int     j;
          int     numBytes;
          byte    tmpbuffer[] = new byte[bytesPerLine()];
  
          encodeBufferPrefix(outStream);
  
          while (true) {
              numBytes = readFully(inStream, tmpbuffer);
              if (numBytes == 0) {
                  break;
              }
              encodeLinePrefix(outStream, numBytes);
              for (j = 0; j < numBytes; j += bytesPerAtom()) {
  
                  if ((j + bytesPerAtom()) <= numBytes) {
                      encodeAtom(outStream, tmpbuffer, j, bytesPerAtom());
                  } else {
                      encodeAtom(outStream, tmpbuffer, j, (numBytes)- j);
                  }
              }
              if (numBytes < bytesPerLine()) {
                  break;
              } else {
                  encodeLineSuffix(outStream);
              }
          }
          encodeBufferSuffix(outStream);
      }
docs: Encode bytes from the input stream, and write them as text characters
  to the output stream. This method will run until it exhausts the
  input stream, but does not print the line suffix for a final
  line that is shorter than bytesPerLine().