idx
int64
0
41.2k
question
stringlengths
74
4.21k
target
stringlengths
5
888
37,500
public List < JAXBElement < Object > > get_GenericApplicationPropertyOfTunnelPart ( ) { if ( _GenericApplicationPropertyOfTunnelPart == null ) { _GenericApplicationPropertyOfTunnelPart = new ArrayList < JAXBElement < Object > > ( ) ; } return this . _GenericApplicationPropertyOfTunnelPart ; }
Gets the value of the genericApplicationPropertyOfTunnelPart property .
37,501
public List < JAXBElement < Object > > get_GenericApplicationPropertyOfParameterizedTexture ( ) { if ( _GenericApplicationPropertyOfParameterizedTexture == null ) { _GenericApplicationPropertyOfParameterizedTexture = new ArrayList < JAXBElement < Object > > ( ) ; } return this . _GenericApplicationPropertyOfParameteriz...
Gets the value of the genericApplicationPropertyOfParameterizedTexture property .
37,502
public List < JAXBElement < Object > > get_GenericApplicationPropertyOfWaterClosureSurface ( ) { if ( _GenericApplicationPropertyOfWaterClosureSurface == null ) { _GenericApplicationPropertyOfWaterClosureSurface = new ArrayList < JAXBElement < Object > > ( ) ; } return this . _GenericApplicationPropertyOfWaterClosureSu...
Gets the value of the genericApplicationPropertyOfWaterClosureSurface property .
37,503
public List < AbstractGriddedSurfaceType . Row > getRow ( ) { if ( row == null ) { row = new ArrayList < AbstractGriddedSurfaceType . Row > ( ) ; } return this . row ; }
Gets the value of the row property .
37,504
public List < PostalCodeElement . PostalCodeNumber > getPostalCodeNumber ( ) { if ( postalCodeNumber == null ) { postalCodeNumber = new ArrayList < PostalCodeElement . PostalCodeNumber > ( ) ; } return this . postalCodeNumber ; }
Gets the value of the postalCodeNumber property .
37,505
public List < PostalCodeElement . PostalCodeNumberExtension > getPostalCodeNumberExtension ( ) { if ( postalCodeNumberExtension == null ) { postalCodeNumberExtension = new ArrayList < PostalCodeElement . PostalCodeNumberExtension > ( ) ; } return this . postalCodeNumberExtension ; }
Gets the value of the postalCodeNumberExtension property .
37,506
public List < JAXBElement < Object > > get_GenericApplicationPropertyOfHollowSpace ( ) { if ( _GenericApplicationPropertyOfHollowSpace == null ) { _GenericApplicationPropertyOfHollowSpace = new ArrayList < JAXBElement < Object > > ( ) ; } return this . _GenericApplicationPropertyOfHollowSpace ; }
Gets the value of the genericApplicationPropertyOfHollowSpace property .
37,507
public List < JAXBElement < Object > > get_GenericApplicationPropertyOfBridgeFurniture ( ) { if ( _GenericApplicationPropertyOfBridgeFurniture == null ) { _GenericApplicationPropertyOfBridgeFurniture = new ArrayList < JAXBElement < Object > > ( ) ; } return this . _GenericApplicationPropertyOfBridgeFurniture ; }
Gets the value of the genericApplicationPropertyOfBridgeFurniture property .
37,508
public List < JAXBElement < AbstractRingPropertyType > > getInterior ( ) { if ( interior == null ) { interior = new ArrayList < JAXBElement < AbstractRingPropertyType > > ( ) ; } return this . interior ; }
Gets the value of the interior property .
37,509
public List < JAXBElement < Object > > get_GenericApplicationPropertyOfBridgeConstructionElement ( ) { if ( _GenericApplicationPropertyOfBridgeConstructionElement == null ) { _GenericApplicationPropertyOfBridgeConstructionElement = new ArrayList < JAXBElement < Object > > ( ) ; } return this . _GenericApplicationProper...
Gets the value of the genericApplicationPropertyOfBridgeConstructionElement property .
37,510
public List < JAXBElement < ? extends AbstractCurveType > > get_Curve ( ) { if ( _Curve == null ) { _Curve = new ArrayList < JAXBElement < ? extends AbstractCurveType > > ( ) ; } return this . _Curve ; }
Gets the value of the curve property .
37,511
public List < JAXBElement < Object > > get_GenericApplicationPropertyOfTexture ( ) { if ( _GenericApplicationPropertyOfTexture == null ) { _GenericApplicationPropertyOfTexture = new ArrayList < JAXBElement < Object > > ( ) ; } return this . _GenericApplicationPropertyOfTexture ; }
Gets the value of the genericApplicationPropertyOfTexture property .
37,512
public List < SubPremiseType . SubPremiseName > getSubPremiseName ( ) { if ( subPremiseName == null ) { subPremiseName = new ArrayList < SubPremiseType . SubPremiseName > ( ) ; } return this . subPremiseName ; }
Gets the value of the subPremiseName property .
37,513
public List < SubPremiseType . SubPremiseNumber > getSubPremiseNumber ( ) { if ( subPremiseNumber == null ) { subPremiseNumber = new ArrayList < SubPremiseType . SubPremiseNumber > ( ) ; } return this . subPremiseNumber ; }
Gets the value of the subPremiseNumber property .
37,514
public List < SubPremiseType . SubPremiseNumberPrefix > getSubPremiseNumberPrefix ( ) { if ( subPremiseNumberPrefix == null ) { subPremiseNumberPrefix = new ArrayList < SubPremiseType . SubPremiseNumberPrefix > ( ) ; } return this . subPremiseNumberPrefix ; }
Gets the value of the subPremiseNumberPrefix property .
37,515
public List < SubPremiseType . SubPremiseNumberSuffix > getSubPremiseNumberSuffix ( ) { if ( subPremiseNumberSuffix == null ) { subPremiseNumberSuffix = new ArrayList < SubPremiseType . SubPremiseNumberSuffix > ( ) ; } return this . subPremiseNumberSuffix ; }
Gets the value of the subPremiseNumberSuffix property .
37,516
public List < JAXBElement < Object > > get_GenericApplicationPropertyOfWallSurface ( ) { if ( _GenericApplicationPropertyOfWallSurface == null ) { _GenericApplicationPropertyOfWallSurface = new ArrayList < JAXBElement < Object > > ( ) ; } return this . _GenericApplicationPropertyOfWallSurface ; }
Gets the value of the genericApplicationPropertyOfWallSurface property .
37,517
public List < JAXBElement < Object > > get_GenericApplicationPropertyOfWindow ( ) { if ( _GenericApplicationPropertyOfWindow == null ) { _GenericApplicationPropertyOfWindow = new ArrayList < JAXBElement < Object > > ( ) ; } return this . _GenericApplicationPropertyOfWindow ; }
Gets the value of the genericApplicationPropertyOfWindow property .
37,518
public List < JAXBElement < Object > > get_GenericApplicationPropertyOfFloorSurface ( ) { if ( _GenericApplicationPropertyOfFloorSurface == null ) { _GenericApplicationPropertyOfFloorSurface = new ArrayList < JAXBElement < Object > > ( ) ; } return this . _GenericApplicationPropertyOfFloorSurface ; }
Gets the value of the genericApplicationPropertyOfFloorSurface property .
37,519
public List < JAXBElement < ? extends AbstractSolidType > > get_Solid ( ) { if ( _Solid == null ) { _Solid = new ArrayList < JAXBElement < ? extends AbstractSolidType > > ( ) ; } return this . _Solid ; }
Gets the value of the solid property .
37,520
public List < JAXBElement < Object > > get_GenericApplicationPropertyOfWaterBody ( ) { if ( _GenericApplicationPropertyOfWaterBody == null ) { _GenericApplicationPropertyOfWaterBody = new ArrayList < JAXBElement < Object > > ( ) ; } return this . _GenericApplicationPropertyOfWaterBody ; }
Gets the value of the genericApplicationPropertyOfWaterBody property .
37,521
public List < JAXBElement < Object > > get_GenericApplicationPropertyOfAbstractTunnel ( ) { if ( _GenericApplicationPropertyOfAbstractTunnel == null ) { _GenericApplicationPropertyOfAbstractTunnel = new ArrayList < JAXBElement < Object > > ( ) ; } return this . _GenericApplicationPropertyOfAbstractTunnel ; }
Gets the value of the genericApplicationPropertyOfAbstractTunnel property .
37,522
public List < JAXBElement < Object > > get_GenericApplicationPropertyOfBuildingFurniture ( ) { if ( _GenericApplicationPropertyOfBuildingFurniture == null ) { _GenericApplicationPropertyOfBuildingFurniture = new ArrayList < JAXBElement < Object > > ( ) ; } return this . _GenericApplicationPropertyOfBuildingFurniture ; ...
Gets the value of the genericApplicationPropertyOfBuildingFurniture property .
37,523
public List < JAXBElement < Object > > get_GenericApplicationPropertyOfRailway ( ) { if ( _GenericApplicationPropertyOfRailway == null ) { _GenericApplicationPropertyOfRailway = new ArrayList < JAXBElement < Object > > ( ) ; } return this . _GenericApplicationPropertyOfRailway ; }
Gets the value of the genericApplicationPropertyOfRailway property .
37,524
public List < JAXBElement < ? extends AbstractPositionalAccuracyType > > get_PositionalAccuracy ( ) { if ( _PositionalAccuracy == null ) { _PositionalAccuracy = new ArrayList < JAXBElement < ? extends AbstractPositionalAccuracyType > > ( ) ; } return this . _PositionalAccuracy ; }
Unordered set of estimates of the impact of this coordinate operation on point position accuracy . Gives position error estimates for target coordinates of this coordinate operation assuming no errors in source coordinates . Gets the value of the positionalAccuracy property .
37,525
public final static byte [ ] toByteArray ( String uid ) { byte [ ] result = new byte [ 16 ] ; char [ ] chars = uid . toCharArray ( ) ; int r = 0 ; for ( int i = 0 ; i < chars . length ; ++ i ) { if ( chars [ i ] == '-' ) { continue ; } int h1 = Character . digit ( chars [ i ] , 16 ) ; ++ i ; int h2 = Character . digit ...
Returns a byte array for the given uuid or guid .
37,526
public static String getPrettyFormatted ( String str ) { return String . format ( "%s-%s-%s-%s-%s" , new Object [ ] { str . substring ( 0 , 8 ) , str . substring ( 8 , 12 ) , str . substring ( 12 , 16 ) , str . substring ( 16 , 20 ) , str . substring ( 20 ) } ) ; }
Returns a nice neat formatted string .
37,527
@ SuppressWarnings ( "unchecked" ) public void setWriterPostProcessor ( String writerPostProcessor ) { if ( writePostProcessors == null ) { writePostProcessors = new LinkedList < > ( ) ; } try { writePostProcessors . add ( ( Class < IPostProcessor > ) Class . forName ( writerPostProcessor ) ) ; } catch ( Exception e ) ...
Sets a writer post processor .
37,528
@ SuppressWarnings ( "unchecked" ) public void setWriterPostProcessors ( Set < String > writerPostProcessors ) { if ( writePostProcessors == null ) { writePostProcessors = new LinkedList < > ( ) ; } for ( String writerPostProcessor : writerPostProcessors ) { try { writePostProcessors . add ( ( Class < IPostProcessor > ...
Sets a group of writer post processors .
37,529
public int getBitRate ( ) { int result ; switch ( audioVersionId ) { case 1 : return - 1 ; case 0 : case 2 : if ( layerDescription == 3 ) { result = BITRATES [ 3 ] [ bitRateIndex ] ; } else if ( layerDescription == 2 || layerDescription == 1 ) { result = BITRATES [ 4 ] [ bitRateIndex ] ; } else { return - 1 ; } break ;...
Getter for bitrate
37,530
public int frameSize ( ) { switch ( layerDescription ) { case 3 : return ( 12 * getBitRate ( ) / getSampleRate ( ) + ( paddingBit ? 1 : 0 ) ) * 4 ; case 2 : case 1 : if ( audioVersionId == 3 ) { return 144 * getBitRate ( ) / getSampleRate ( ) + ( paddingBit ? 1 : 0 ) ; } else { return 72 * getBitRate ( ) / getSampleRat...
Calculate the size of a MP3 frame for this header .
37,531
public void setMetaCue ( IMetaCue [ ] cuePoints ) { Map < String , Object > cues = new HashMap < String , Object > ( ) ; this . cuePoints = cuePoints ; int j = 0 ; for ( j = 0 ; j < this . cuePoints . length ; j ++ ) { cues . put ( String . valueOf ( j ) , this . cuePoints [ j ] ) ; } this . put ( "cuePoints" , cues ) ...
Sets the Meta Cue Points
37,532
public static void dumpBox ( Container box ) { log . debug ( "Dump box: {}" , box ) ; for ( Box bx : box . getBoxes ( ) ) { log . debug ( "{} child: {}" , box , bx . getType ( ) ) ; } }
Dumps the children of a container box .
37,533
private void createPreStreamingTags ( int timestamp , boolean clear ) { log . debug ( "Creating pre-streaming tags" ) ; if ( clear ) { firstTags . clear ( ) ; } ITag tag = null ; IoBuffer body = null ; if ( hasVideo ) { body = IoBuffer . allocate ( 41 ) ; body . setAutoExpand ( true ) ; body . put ( PREFIX_VIDEO_CONFIG...
Tag sequence MetaData Video config Audio config remaining audio and video
37,534
public ITag readTag ( ) { ITag tag = null ; if ( log . isTraceEnabled ( ) ) { log . trace ( "Read tag - prevFrameSize {} audio: {} video: {}" , new Object [ ] { prevFrameSize , audioCount , videoCount } ) ; } if ( ! frames . isEmpty ( ) ) { try { lock . acquire ( ) ; if ( ! firstTags . isEmpty ( ) ) { return firstTags ...
Packages media data for return to providers
37,535
private void ensureAvailable ( int index ) { if ( data . get ( index ) != null ) { return ; } if ( client == null ) { throw new RuntimeException ( "no remoting client configured" ) ; } Object result ; int start = index ; int count ; if ( mode . equals ( MODE_ONDEMAND ) ) { count = 1 ; } else if ( mode . equals ( MODE_F...
Make sure the passed item has been fetched from the server .
37,536
public List < Object > getItemAt ( int index ) { if ( index < 0 || index >= totalCount ) { return null ; } ensureAvailable ( index ) ; return data . get ( index ) ; }
Return a specified item from the recordset . If the item is not available yet it will be received from the server .
37,537
public int getNumberAvailable ( ) { int result = 0 ; for ( int i = 0 ; i < data . size ( ) ; i ++ ) { if ( data . get ( i ) != null ) { result += 1 ; } } return result ; }
Get the number of items already received from the server .
37,538
public Map < String , Object > serialize ( ) { Map < String , Object > serverInfo = new HashMap < String , Object > ( ) ; serverInfo . put ( "totalCount" , totalCount ) ; serverInfo . put ( "cursor" , cursor ) ; serverInfo . put ( "serviceName" , serviceName ) ; serverInfo . put ( "columnNames" , columns ) ; serverInfo...
Return Map that can be serialized as result .
37,539
public static Document stringToDoc ( String str ) throws IOException { if ( StringUtils . isNotEmpty ( str ) ) { try ( Reader reader = new StringReader ( str ) ) { DocumentBuilder db = DocumentBuilderFactory . newInstance ( ) . newDocumentBuilder ( ) ; Document doc = db . parse ( new InputSource ( reader ) ) ; return d...
Converts string representation of XML into Document
37,540
public static String docToString1 ( Document dom ) { StringWriter sw = new StringWriter ( ) ; DOM2Writer . serializeAsXML ( dom , sw ) ; return sw . toString ( ) ; }
Convert a DOM tree into a String using Dom2Writer
37,541
public static String docToString2 ( Document domDoc ) throws IOException { try { TransformerFactory transFact = TransformerFactory . newInstance ( ) ; Transformer trans = transFact . newTransformer ( ) ; trans . setOutputProperty ( OutputKeys . INDENT , "no" ) ; StringWriter sw = new StringWriter ( ) ; Result result = ...
Convert a DOM tree into a String using transform
37,542
@ SuppressWarnings ( { "unchecked" , "rawtypes" } ) public static Object convert ( Object source , Class < ? > target ) throws ConversionException { if ( target == null ) { throw new ConversionException ( "Unable to perform conversion, target was null" ) ; } if ( source == null ) { if ( target . isPrimitive ( ) ) { thr...
Convert source to given class
37,543
public static Object convertToArray ( Object source , Class < ? > target ) throws ConversionException { try { Class < ? > targetType = target . getComponentType ( ) ; if ( source . getClass ( ) . isArray ( ) ) { Object targetInstance = Array . newInstance ( targetType , Array . getLength ( source ) ) ; for ( int i = 0 ...
Convert to array
37,544
public static Object convertToWrappedPrimitive ( Object source , Class < ? > wrapper ) { if ( source == null || wrapper == null ) { return null ; } if ( wrapper . isInstance ( source ) ) { return source ; } if ( wrapper . isAssignableFrom ( source . getClass ( ) ) ) { return source ; } if ( source instanceof Number ) {...
Convert to wrapped primitive
37,545
public static Object convertStringToWrapper ( String str , Class < ? > wrapper ) { log . trace ( "String: {} to wrapper: {}" , str , wrapper ) ; if ( wrapper . equals ( String . class ) ) { return str ; } else if ( wrapper . equals ( Boolean . class ) ) { return Boolean . valueOf ( str ) ; } else if ( wrapper . equals ...
Convert string to primitive wrapper like Boolean or Float
37,546
public static Object convertNumberToWrapper ( Number num , Class < ? > wrapper ) { if ( wrapper . equals ( String . class ) ) { return num . toString ( ) ; } else if ( wrapper . equals ( Boolean . class ) ) { return Boolean . valueOf ( num . intValue ( ) == 1 ) ; } else if ( wrapper . equals ( Double . class ) ) { retu...
Convert number to primitive wrapper like Boolean or Float
37,547
public static List < Method > findMethodsByNameAndNumParams ( Object object , String method , int numParam ) { LinkedList < Method > list = new LinkedList < Method > ( ) ; Method [ ] methods = object . getClass ( ) . getMethods ( ) ; for ( Method m : methods ) { String methodName = m . getName ( ) ; if ( ignoredMethodN...
Find method by name and number of parameters
37,548
public static Object [ ] convertParams ( Object [ ] source , Class < ? > [ ] target ) throws ConversionException { Object [ ] converted = new Object [ target . length ] ; for ( int i = 0 ; i < target . length ; i ++ ) { converted [ i ] = convert ( source [ i ] , target [ i ] ) ; } return converted ; }
Convert parameters using methods of this utility class
37,549
public static Class < ? > [ ] convertParams ( Object [ ] source ) { Class < ? > [ ] converted = null ; if ( source != null ) { converted = new Class < ? > [ source . length ] ; for ( int i = 0 ; i < source . length ; i ++ ) { if ( source [ i ] != null ) { converted [ i ] = source [ i ] . getClass ( ) ; } else { convert...
Convert parameters using methods of this utility class . Special handling is afforded to classes that implement IConnection .
37,550
public static Object convertMapToBean ( Map < String , ? extends Object > source , Class < ? > target ) throws ConversionException { Object bean = newInstance ( target ) ; if ( bean == null ) { bean = newInstance ( target . getName ( ) ) ; if ( bean == null ) { throw new ConversionException ( "Unable to create bean usi...
Convert map to bean
37,551
public static Set < ? > convertArrayToSet ( Object [ ] source ) { Set < Object > set = new HashSet < Object > ( ) ; for ( Object element : source ) { set . add ( element ) ; } return set ; }
Convert array to set removing duplicates
37,552
private ITag createFileMeta ( ) { log . debug ( "createFileMeta" ) ; IoBuffer in = IoBuffer . allocate ( 1024 ) ; in . setAutoExpand ( true ) ; Output out = new Output ( in ) ; out . writeString ( "onMetaData" ) ; Map < Object , Object > props = new HashMap < Object , Object > ( ) ; props . put ( "audiocodecid" , IoCon...
Creates file metadata object
37,553
protected void writeArbitraryObject ( Object object ) { log . debug ( "writeObject" ) ; Class < ? > objectClass = object . getClass ( ) ; if ( ! objectClass . isAnnotationPresent ( Anonymous . class ) ) { buf . put ( AMF . TYPE_CLASS_OBJECT ) ; putString ( buf , Serializer . getClassName ( objectClass ) ) ; } else { bu...
Writes an arbitrary object to the output .
37,554
protected static byte [ ] encodeString ( String string ) { Element element = getStringCache ( ) . get ( string ) ; byte [ ] encoded = ( element == null ? null : ( byte [ ] ) element . getObjectValue ( ) ) ; if ( encoded == null ) { ByteBuffer buf = AMF . CHARSET . encode ( string ) ; encoded = new byte [ buf . limit ( ...
Encode string .
37,555
public static void putString ( IoBuffer buf , String string ) { final byte [ ] encoded = encodeString ( string ) ; if ( encoded . length < AMF . LONG_STRING_LENGTH ) { buf . put ( ( byte ) ( ( encoded . length >> 8 ) & 0xff ) ) ; buf . put ( ( byte ) ( encoded . length & 0xff ) ) ; } else { buf . putInt ( encoded . len...
Write out string
37,556
public void writeHeader ( ) throws IOException , ConverterException { if ( append ) { return ; } try { CompoundTag ebml = TagFactory . < CompoundTag > create ( "EBML" ) . add ( TagFactory . < UnsignedIntegerTag > create ( "EBMLVersion" ) . setValue ( 1 ) ) . add ( TagFactory . < UnsignedIntegerTag > create ( "EBMLReadV...
method to write webm header to the new file
37,557
public void writeTag ( Tag tag ) throws IOException { byte [ ] hb = tag . encode ( ) ; bytesWritten += hb . length ; dataFile . write ( hb ) ; }
will write tag bytesWritten counter will be increased by the number of bytes actually written
37,558
public void close ( ) throws IOException { if ( dataFile != null ) { if ( ! append ) { dataFile . seek ( 0 ) ; try ( RandomAccessFile rf = new RandomAccessFile ( file , "rw" ) ) { rf . getChannel ( ) . transferFrom ( dataFile . getChannel ( ) , 0 , dataFile . length ( ) ) ; } } try { dataFile . close ( ) ; dataFile = n...
Will close all opened resources and finalize the write process
37,559
private void createPreStreamingTags ( ) { log . debug ( "Creating pre-streaming tags" ) ; if ( audioDecoderBytes != null ) { IoBuffer body = IoBuffer . allocate ( audioDecoderBytes . length + 3 ) ; body . put ( new byte [ ] { ( byte ) 0xaf , ( byte ) 0 } ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( "Audio decode...
Tag sequence MetaData Audio config remaining audio
37,560
public ITag readTag ( ) { ITag tag = null ; try { lock . acquire ( ) ; if ( ! firstTags . isEmpty ( ) ) { log . debug ( "Returning pre-tag" ) ; return firstTags . removeFirst ( ) ; } MP4Frame frame = frames . get ( currentFrame ) ; log . debug ( "Playback {}" , frame ) ; int sampleSize = frame . getSize ( ) ; int time ...
Packages media data for return to providers .
37,561
public static void serializeAsXML ( Node node , Writer writer ) { PrintWriter out = new PrintWriter ( writer ) ; print ( node , out ) ; out . flush ( ) ; }
Serialize this node into the writer as XML .
37,562
private static void print ( Node node , PrintWriter out ) { if ( node == null ) { return ; } boolean hasChildren = false ; int type = node . getNodeType ( ) ; NodeList children = null ; switch ( type ) { case Node . DOCUMENT_NODE : children = node . getChildNodes ( ) ; if ( children != null ) { int numChildren = childr...
Dumps DOM node
37,563
@ SuppressWarnings ( "rawtypes" ) protected static boolean writeBasic ( Output out , Object basic ) { if ( basic == null ) { out . writeNull ( ) ; } else if ( basic instanceof Boolean ) { out . writeBoolean ( ( Boolean ) basic ) ; } else if ( basic instanceof Number ) { out . writeNumber ( ( Number ) basic ) ; } else i...
Writes a primitive out as an object
37,564
public static boolean writeComplex ( Output out , Object complex ) { log . trace ( "writeComplex" ) ; if ( writeListType ( out , complex ) ) { return true ; } else if ( writeArrayType ( out , complex ) ) { return true ; } else if ( writeXMLType ( out , complex ) ) { return true ; } else if ( writeCustomType ( out , com...
Writes a complex type object out
37,565
protected static boolean writeListType ( Output out , Object listType ) { log . trace ( "writeListType" ) ; if ( listType instanceof List < ? > ) { writeList ( out , ( List < ? > ) listType ) ; } else { return false ; } return true ; }
Writes Lists out as a data type
37,566
protected static void writeList ( Output out , List < ? > list ) { if ( ! list . isEmpty ( ) ) { int size = list . size ( ) ; if ( size < 100 ) { out . writeArray ( list ) ; return ; } int nullCount = 0 ; for ( int i = 0 ; i < size ; i ++ ) { if ( list . get ( i ) == null ) { nullCount ++ ; } } if ( nullCount > ( size ...
Writes a List out as an Object
37,567
protected static void writeIterator ( Output out , Iterator < Object > it ) { log . trace ( "writeIterator" ) ; LinkedList < Object > list = new LinkedList < Object > ( ) ; while ( it . hasNext ( ) ) { list . addLast ( it . next ( ) ) ; } out . writeArray ( list ) ; }
Writes an iterator out to the output
37,568
protected static boolean writeXMLType ( Output out , Object xml ) { log . trace ( "writeXMLType" ) ; if ( xml instanceof Document ) { writeDocument ( out , ( Document ) xml ) ; } else { return false ; } return true ; }
Writes an xml type out to the output
37,569
@ SuppressWarnings ( "all" ) protected static boolean writeObjectType ( Output out , Object obj ) { if ( obj instanceof ObjectMap || obj instanceof BeanMap ) { out . writeObject ( ( Map ) obj ) ; } else if ( obj instanceof Map ) { out . writeMap ( ( Map ) obj ) ; } else if ( obj instanceof RecordSet ) { out . writeReco...
Write typed object to the output
37,570
protected static boolean writeCustomType ( Output out , Object obj ) { if ( out . isCustom ( obj ) ) { out . writeCustom ( obj ) ; return true ; } else { return false ; } }
Writes a custom data to the output
37,571
public static boolean serializeField ( String keyName , Field field , Method getter ) { log . trace ( "serializeField - keyName: {} field: {} method: {}" , new Object [ ] { keyName , field , getter } ) ; if ( "class" . equals ( keyName ) ) { return false ; } if ( field != null ) { if ( Modifier . isTransient ( field . ...
Checks whether the field should be serialized or not
37,572
public static String getClassName ( Class < ? > objectClass ) { RemoteClass annotation = objectClass . getAnnotation ( RemoteClass . class ) ; if ( annotation != null ) { return annotation . alias ( ) ; } String className = objectClass . getName ( ) ; if ( className . startsWith ( "org.red5.compatibility." ) ) { classN...
Handles classes by name also provides shortened class aliases where appropriate .
37,573
protected void storeReference ( Object obj ) { refMap . put ( new IdentityWrapper ( obj ) , Short . valueOf ( refId ++ ) ) ; }
Store an object into a map
37,574
private void updateSize ( IoBuffer data ) { this . widthInfo = data . getShort ( ) ; this . heightInfo = data . getShort ( ) ; this . width = this . widthInfo & 0xfff ; this . height = this . heightInfo & 0xfff ; this . blockWidth = this . widthInfo & 0xf000 ; this . blockWidth = ( this . blockWidth >> 12 ) + 1 ; this ...
Update total block size
37,575
public byte readDataType ( ) { if ( buf . hasRemaining ( ) ) { do { currentDataType = buf . get ( ) ; log . trace ( "Data type: {}" , currentDataType ) ; switch ( currentDataType ) { case AMF . TYPE_NULL : case AMF . TYPE_UNDEFINED : return DataTypes . CORE_NULL ; case AMF . TYPE_NUMBER : return DataTypes . CORE_NUMBER...
Reads the data type .
37,576
public Boolean readBoolean ( ) { return ( buf . get ( ) == AMF . VALUE_TRUE ) ? Boolean . TRUE : Boolean . FALSE ; }
Reads a boolean .
37,577
public Number readNumber ( ) { int remaining = buf . remaining ( ) ; log . debug ( "readNumber from {} bytes" , remaining ) ; if ( remaining >= 8 ) { double d = buf . getDouble ( ) ; log . debug ( "Number: {}" , d ) ; return d ; } if ( log . isDebugEnabled ( ) ) { log . debug ( "Remaining not big enough for number - of...
Reads a Number . In ActionScript 1 and 2 Number type represents all numbers both floats and integers .
37,578
public String getString ( ) { log . trace ( "getString - currentDataType: {}" , currentDataType ) ; byte lastDataType = currentDataType ; if ( currentDataType != AMF . TYPE_STRING ) { currentDataType = AMF . TYPE_STRING ; } String result = readString ( ) ; currentDataType = lastDataType ; return result ; }
Reads string from buffer
37,579
private final String bufferToString ( byte [ ] str ) { String string = null ; if ( str != null ) { string = AMF . CHARSET . decode ( ByteBuffer . wrap ( str ) ) . toString ( ) ; log . debug ( "String: {}" , string ) ; } else { log . warn ( "ByteBuffer was null attempting to read String" ) ; } return string ; }
Converts the bytes into a string .
37,580
public Map < String , Object > readKeyValues ( ) { Map < String , Object > result = new HashMap < String , Object > ( ) ; readKeyValues ( result ) ; return result ; }
Read key - value pairs . This is required for the RecordSet deserializer .
37,581
protected void readKeyValues ( Map < String , Object > result ) { while ( hasMoreProperties ( ) ) { String name = readPropertyName ( ) ; log . debug ( "property: {}" , name ) ; Object property = Deserializer . deserialize ( this , Object . class ) ; log . debug ( "val: {}" , property ) ; result . put ( name , property ...
Read key - value pairs into Map object
37,582
@ SuppressWarnings ( "all" ) protected Object newInstance ( String className ) { log . debug ( "Loading class: {}" , className ) ; Object instance = null ; Class < ? > clazz = null ; if ( "" . equals ( className ) || className == null ) return instance ; try { if ( className . length ( ) == 3 ) { className = classAlias...
Creates a new instance of the className parameter and returns as an Object
37,583
@ SuppressWarnings ( { "unchecked" , "rawtypes" } ) protected Object readBean ( Object bean ) { log . debug ( "readBean: {}" , bean ) ; storeReference ( bean ) ; Class theClass = bean . getClass ( ) ; while ( hasMoreProperties ( ) ) { String name = readPropertyName ( ) ; Type type = getPropertyType ( bean , name ) ; lo...
Reads the input as a bean and returns an object
37,584
protected Map < String , Object > readSimpleObject ( ) { log . debug ( "readSimpleObject" ) ; Map < String , Object > result = new ObjectMap < > ( ) ; readKeyValues ( result ) ; storeReference ( result ) ; return result ; }
Reads the input as a map and returns a Map
37,585
public Object readObject ( ) { String className ; if ( currentDataType == AMF . TYPE_CLASS_OBJECT ) { className = getString ( ) ; log . debug ( "readObject: {}" , className ) ; if ( className != null ) { log . debug ( "read class object" ) ; Object result = null ; Object instance ; if ( className . equals ( "RecordSet"...
Reads start object
37,586
public boolean hasMoreProperties ( ) { if ( buf . remaining ( ) >= 3 ) { byte [ ] threeBytes = new byte [ 3 ] ; int pos = buf . position ( ) ; buf . get ( threeBytes ) ; if ( Arrays . equals ( AMF . END_OF_OBJECT_SEQUENCE , threeBytes ) ) { log . trace ( "End of object" ) ; return false ; } buf . position ( pos ) ; ret...
Returns a boolean stating whether there are more properties
37,587
@ SuppressWarnings ( { "unchecked" } ) public static IMeta mergeMeta ( IMetaData < ? , ? > metaData1 , IMetaData < ? , ? > metaData2 ) { Map < String , Object > map1 = ( ( Map < String , Object > ) metaData1 ) ; Set < Entry < String , Object > > set1 = map1 . entrySet ( ) ; Map < String , Object > map2 = ( ( Map < Stri...
Merges the two Meta objects
37,588
public void readData ( InputStream inputStream ) throws IOException { if ( inputStream == null ) { return ; } data = ParserUtils . parseBinary ( inputStream , ( int ) size . getValue ( ) ) ; }
method to read tag data from inputStream given
37,589
protected void addParameters ( StringBuilder result ) { result . append ( "ts=" ) ; result . append ( timestamp ) ; result . append ( ",headers=" ) ; result . append ( headers ) ; result . append ( ",body=" ) ; result . append ( body ) ; result . append ( ",messageId=" ) ; result . append ( messageId ) ; result . appen...
Add message properties to string .
37,590
public void writeHeader ( ) throws IOException { ByteBuffer buf = ByteBuffer . allocate ( HEADER_LENGTH + 4 ) ; FLVHeader flvHeader = new FLVHeader ( ) ; flvHeader . setFlagAudio ( audioCodecId != - 1 ? true : false ) ; flvHeader . setFlagVideo ( videoCodecId != - 1 ? true : false ) ; flvHeader . write ( buf ) ; create...
Writes the header bytes
37,591
private void createOutputFile ( ) throws IOException { this . fileChannel = Files . newByteChannel ( Paths . get ( filePath ) , StandardOpenOption . CREATE , StandardOpenOption . WRITE , StandardOpenOption . TRUNCATE_EXISTING ) ; }
Create the stream output file ; the flv itself .
37,592
private void createDataFile ( ) throws IOException { Path path = Paths . get ( filePath + ".ser" ) ; if ( Files . deleteIfExists ( path ) ) { log . debug ( "Previous flv data file existed and was removed" ) ; } this . dataChannel = Files . newByteChannel ( path , StandardOpenOption . CREATE_NEW , StandardOpenOption . W...
Create the stream data file .
37,593
private void createRepairDataFile ( ) throws IOException { Path path = Paths . get ( filePath + ".ser" ) ; this . dataChannel = Files . newByteChannel ( path , StandardOpenOption . READ ) ; }
Create the stream data file for repair .
37,594
private static int [ ] readInfoFile ( File tmpFile ) { int [ ] info = new int [ 8 ] ; try ( RandomAccessFile infoFile = new RandomAccessFile ( tmpFile , "r" ) ) { info [ 0 ] = infoFile . readInt ( ) ; info [ 1 ] = infoFile . readInt ( ) ; info [ 2 ] = infoFile . readInt ( ) ; info [ 3 ] = infoFile . readInt ( ) ; info ...
Read flv file information from pre - finalization file .
37,595
private void updateInfoFile ( ) { try ( RandomAccessFile infoFile = new RandomAccessFile ( filePath + ".info" , "rw" ) ) { infoFile . writeInt ( audioCodecId ) ; infoFile . writeInt ( videoCodecId ) ; infoFile . writeInt ( duration ) ; infoFile . writeInt ( audioDataSize ) ; infoFile . writeInt ( soundRate ) ; infoFile...
Write or update flv file information into the pre - finalization file .
37,596
public void close ( ) { log . debug ( "close" ) ; boolean locked = false ; try { locked = lock . tryAcquire ( 500L , TimeUnit . MILLISECONDS ) ; if ( locked ) { finalizeFlv ( ) ; } } catch ( InterruptedException e ) { log . warn ( "Exception acquiring lock" , e ) ; } finally { if ( locked ) { lock . release ( ) ; } if ...
Ends the writing process then merges the data file with the flv file header and metadata .
37,597
public static boolean repair ( String path , Integer audioId , Integer videoId ) throws InterruptedException { boolean result = false ; FLVWriter writer = null ; log . debug ( "Serial file path: " + path ) ; System . out . println ( "Serial file path: " + path ) ; if ( path . endsWith ( ".ser" ) ) { File ser = new File...
Allows repair of flv files if . info and . ser files still exist .
37,598
private Future < ? > submit ( FLVFinalizer flvFinalizer ) { if ( executor != null && ! executor . isTerminated ( ) ) { return executor . submit ( flvFinalizer ) ; } return null ; }
Submits a finalizer internally .
37,599
public static void main ( String [ ] args ) throws InterruptedException { if ( args == null || args [ 0 ] == null ) { System . err . println ( "Provide the path to your .ser file" ) ; } else { repair ( args [ 0 ] , args . length > 1 && args [ 1 ] != null ? Integer . valueOf ( args [ 1 ] ) : null , args . length > 2 && ...
Exposed to allow repair of flv files if . info and . ser files still exist .