FieldInfo (..),
MethodInfo (..),
AttributeInfo (..),
- FieldType,
- FieldSignature, MethodSignature (..), ReturnSignature (..)
+ FieldType (..),
+ FieldSignature, MethodSignature (..), ReturnSignature (..),
+ ArgumentSignature (..)
)
where
classMethodsCount <- get
classMethods <- replicateM (fromIntegral classMethodsCount) get
asCount <- get
- as <- replicateM (fromIntegral $ asCount - 1) get
+ as <- replicateM (fromIntegral $ asCount) get
return $ ClassFile magic minor major poolsize pool af this super
interfacesCount ifaces classFieldsCount classFields classMethodsCount classMethods asCount as
| LongInt -- ^ J
| ShortInt -- ^ S
| BoolType -- ^ Z
- | ObjectType String -- ^ L <class name>
- | Array (Maybe Int) FieldType -- ^ [<type>
+ | ObjectType String -- ^ L @{class name}@
+ | Array (Maybe Int) FieldType -- ^ @[{type}@
deriving (Eq)
instance Show FieldType where
return (c: next)
else return []
+putString :: String -> Put
+putString str = forM_ str put
+
instance Binary FieldType where
put SignedByte = put 'B'
put CharByte = put 'C'
put LongInt = put 'J'
put ShortInt = put 'S'
put BoolType = put 'Z'
- put (ObjectType name) = put 'L' >> put name
+ put (ObjectType name) = put 'L' >> putString name >> put ';'
put (Array Nothing sig) = put '[' >> put sig
put (Array (Just n) sig) = put '[' >> put (show n) >> put sig
value <- getLazyByteString (fromIntegral len)
return $ AttributeInfo name len value
-