CloneSet299


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
23201.000method_declaration
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
123532
E:/TSE/Projects-CloneDR/sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeBinary.java
223717
E:/TSE/Projects-CloneDR/sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeBlob.java
Next
Last
Clone Instance
1
Line Count
23
Source Line
532
Source File
E:/TSE/Projects-CloneDR/sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeBinary.java

/**
 * Construct an appropriate external representation of the object
 * and write it to a file.
 * Errors are returned by throwing an IOException containing the
 * cause of the problem as its message.
 * <P>
 * DataType is responsible for validating that the given text
 * text from a Popup JTextArea can be converted to an object.
 * This text-to-object conversion is the same as validateAndConvertInPopup,
 * which may be used internally by the object to do the validation.
 * <P>
 * The DataType object must flush and close the output stream before returning.
 * Typically it will create another object (e.g. an OutputWriter), and
 * that is the object that must be flushed and closed.
 */
public void exportObject(FileOutputStream outStream, String text) throws IOException {
  Byte[] bBytes = BinaryDisplayConverter.convertToBytes(text, BinaryDisplayConverter.HEX, false);
  // check that the text is a valid representation
  StringBuffer messageBuffer = new StringBuffer();
  validateAndConvertInPopup(text, null, messageBuffer);
  if (messageBuffer.length() > 0) {
    // there was an error in the conversion
    throw new IOException(new String(messageBuffer));
  }
  // Convert Bytes to bytes
  byte[] bytes = new byte[bBytes.length];
  for (int i = 0; i < bytes.length; i++)
    bytes[i] = bBytes[i].byteValue();
  // just send the text to the output file
  outStream.write(bytes);
  outStream.flush();
  outStream.close();
}


First
Previous
Clone Instance
2
Line Count
23
Source Line
717
Source File
E:/TSE/Projects-CloneDR/sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeBlob.java

/**
 * Construct an appropriate external representation of the object
 * and write it to a file.
 * Errors are returned by throwing an IOException containing the
 * cause of the problem as its message.
 * <P>
 * DataType is responsible for validating that the given text
 * text from a Popup JTextArea can be converted to an object.
 * This text-to-object conversion is the same as validateAndConvertInPopup,
 * which may be used internally by the object to do the validation.
 * <P>
 * The DataType object must flush and close the output stream before returning.
 * Typically it will create another object (e.g. an OutputWriter), and
 * that is the object that must be flushed and closed.
 * 
 * <P>
 * File is assumed to be and ASCII string of digits
 * representing a value of this data type.
 */
public void exportObject(FileOutputStream outStream, String text) throws IOException {
  Byte[] bBytes = BinaryDisplayConverter.convertToBytes(text, BinaryDisplayConverter.HEX, false);
  // check that the text is a valid representation
  StringBuffer messageBuffer = new StringBuffer();
  validateAndConvertInPopup(text, null, messageBuffer);
  if (messageBuffer.length() > 0) {
    // there was an error in the conversion
    throw new IOException(new String(messageBuffer));
  }
  // Convert Bytes to bytes
  byte[] bytes = new byte[bBytes.length];
  for (int i = 0; i < bytes.length; i++)
    bytes[i] = bBytes[i].byteValue();
  // just send the text to the output file
  outStream.write(bytes);
  outStream.flush();
  outStream.close();
}


Clone AbstractionParameter Count: 0Parameter Bindings

/**
          * Construct an appropriate external representation of the object
          * and write it to a file.
          * Errors are returned by throwing an IOException containing the
          * cause of the problem as its message.
          * <P>
          * DataType is responsible for validating that the given text
          * text from a Popup JTextArea can be converted to an object.
          * This text-to-object conversion is the same as validateAndConvertInPopup,
          * which may be used internally by the object to do the validation.
          * <P>
          * The DataType object must flush and close the output stream before returning.
          * Typically it will create another object (e.g. an OutputWriter), and
          * that is the object that must be flushed and closed.
          */
/**
          * Construct an appropriate external representation of the object
          * and write it to a file.
          * Errors are returned by throwing an IOException containing the
          * cause of the problem as its message.
          * <P>
          * DataType is responsible for validating that the given text
          * text from a Popup JTextArea can be converted to an object.
          * This text-to-object conversion is the same as validateAndConvertInPopup,
          * which may be used internally by the object to do the validation.
          * <P>
          * The DataType object must flush and close the output stream before returning.
          * Typically it will create another object (e.g. an OutputWriter), and
          * that is the object that must be flushed and closed.
          * 
          * <P>
          * File is assumed to be and ASCII string of digits
          * representing a value of this data type.
          */
public void exportObject(FileOutputStream outStream, String text) throws IOException {
  Byte[] bBytes = BinaryDisplayConverter.convertToBytes(text, BinaryDisplayConverter.HEX, false);
  // check that the text is a valid representation
  StringBuffer messageBuffer = new StringBuffer();
  validateAndConvertInPopup(text, null, messageBuffer);
  if (messageBuffer.length() > 0) {
    // there was an error in the conversion
    throw new IOException(new String(messageBuffer));
  }
  // Convert Bytes to bytes
  byte[] bytes = new byte[bBytes.length];
  for (int i = 0; i < bytes.length; i++)
    bytes[i] = bBytes[i].byteValue();
  // just send the text to the output file
  outStream.write(bytes);
  outStream.flush();
  outStream.close();
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
None